• Advertisement
Sign in to follow this  

SDL keyboard input not working

This topic is 3582 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello again. Today I come with a problem involving keyboard input with sdl. What I tried to do was create a keyboard wrapper class to nicely contain the code so I can do simple calls like Keyboard.Release(KEY_A). Unfortunatly I cannot get it to work. I am not sure if the problem pertains to the fact I am calling SDL_Pollevent() twice. One instance is getting called in the game engine loop to check if a quit message was recieved. The other is used for the keyboard input. Does the first one (checking for quit) flush everything as its called? If so any suggestions on how to keep things separate for clarity sake yet at the same time not having conflicts?

Share this post


Link to post
Share on other sites
Advertisement
SDL_PollEvents() will remove events from the queue if any are present. If you want to look at events without removing them from the queue you can use SDL_PeepEvents() with the SDL_PEEKEVENT action.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement