Jump to content
  • Advertisement
Sign in to follow this  
Mad_Coder

Mulitple Key or Mod Events in SDL

This topic is 3908 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!