I have been trying to detect whether or not a person is holding down the
shift and escape key at the same time, I figured that SDL_GetModState
would be the function to detect that SDLK_LSHIFT is being held down.
However, I have been unable to successfully figure out how to use
SDL_GetModState. I really need someone to explain how this function
works None of the examples that I found on the SDL page, or in the
SDL package use this function. Is it obsolote or deprecated now?
Thanks for your time,
DrEvil
@EvilTypeGuy
P.S. Two Examples of my pitiful attempt to figure out SDL_GetModState
follow:
The 1st one:
Uint8 *keys;
keys = SDL_GetKeyState(NULL);
if(SDL_GetModState() == KMOD_LSHIFT) {
if(keys[SDLK_ESCAPE] == SDL_PRESSED) {
printf(âQuittingâŚ\nâ);
}
}
The 2nd one:
Uint8 *keys;
keys = SDL_GetKeyState(NULL);
if ((SDL_GetModState() == SDLK_LSHIFT) && (keys[SDLK_ESCAPE] ==
SDL_PRESSED) ) {
printf(âQuittingâŚ\nâ);
}