I noticed that in "SDL-1.1.6/src/events/SDL_keyboard.c"
in function at line 63: "int SDL_KeyboardInit(void)"
the initial state of key modifiers is KMOD_NONE
SDL_ModState = KMOD_NONE;
This is ok when the program starts itself with
the permanent key modifiers (CapsLock, NumLock…)
in OFF state.
If they are ON SDL returns always the state reversed.
The part of the code that handle the changes is:
case SDLK_NUMLOCK: modstate ^= KMOD_NUM; if ( ! (modstate&KMOD_NUM) ) state = SDL_RELEASED; keysym->mod = (SDLMod)modstate; break; case SDLK_CAPSLOCK: modstate ^= KMOD_CAPS; if ( ! (modstate&KMOD_CAPS) ) state = SDL_RELEASED; keysym->mod = (SDLMod)modstate; break;
that only invert the current bit state when the key is pressed.
I think that in SDL_KeyboardInit we must add something that
gets the current state of the keyboard to set the first
Is this right?
Thanks for any comment.