Sign in to follow this  

Mulitple Key or Mod Events in SDL

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

This topic is 3628 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this