SDL Forum Index
SDL
Simple DirectMedia Layer Forums
Reply to topic
Is it possible to get input from devices without a window?
Leepurr


Joined: 26 Jun 2016
Posts: 1
Location: UK
Reply with quote
Hi Everyone,

I'm just curious if anyone knows a way of detecting input from a keyboard and/or gamepad using SDL2 without first creating a window. I want to be able to process input using SDL2 to use inside of the console (in windows) for a small console game I'm creating. So far I have tried the polling events method of getting input from the keyboard, and I've also tried using the keystates method. Neither method worked unless I generated a window first however I don't require a window for the game itself. Is it possible to detect input without generating a window?

My next step is going to be to try generating a window and then hiding it but I'm assuming as with most applications that if the focus isn't on the window (e.g. the window is minimized) then the input will stop being detected.

I thought before attempting this I would ask for any suggestions that might be better then this approach?

Thanks Very Happy

Martyn
View user's profileSend private message
bigov


Joined: 03 Jul 2016
Posts: 7
Reply with quote
Let's see the page - https://wiki.libsdl.org/CategoryEvents

As well, if need, you can create hidden window and handle events from it.
View user's profileSend private message
Is it possible to get input from devices without a window?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic