Jump to content
  • Advertisement
Sign in to follow this  

Mulitple Key or Mod Events in SDL

This topic is 3992 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

In SDL, I want to poll events and check if the current type is SDL_KEYDOWN and check if a key modifier event is enabled and a key event occurred for this SDL_KEYDOWN event (the person pressed a key numbers 97-122 a-z and caps lock is enabled). I tried to do this by checking for a KMOD_CAPS modifier with SDL_GetModifier() to be enabled when the user pressed keys a-z and it works in all cases besides when Num Lock is already enabled before the user enabled the caps lock key and pressed for example the 'a' key. This results in the current key modifier being KMOD_NUM since it was enabled first. How can I check if one of several key modifiers is enabled? is this done through the or | operator? Intellisence tell me that the mod enabled is just KMOD_NUM when I step into the program and not KMOD_NUM | KMOD_CAPS? The version I am running the code on MSVC++ 2003 and Intelisence has only been near incorrect on 08.

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!