NumLock state |
Re: NumLock state |
AlexRou
|
GetModState actually is working, its just that on startup the mod state is always off so when you press numlock while its on before starting the application the state gets reversed. You can either use platform specific methods to get the key state or use platform specific methods to toggle the LED so its off on start.
(SDL_GetModState() & KMOD_NUM) == (KMOD_NUM)
|
|||||||||||||
|
Re: NumLock state |
bibendovsky
|
[quote="AlexRou"]GetModState actually is working, its just that on startup the mod state is always off so when you press numlock while its on before starting the application the state gets reversed. You can either use platform specific methods to get the key state or use platform specific methods to toggle the LED so its off on start.
(SDL_GetModState() & KMOD_NUM) == (KMOD_NUM) [quote="bibendovsky"]Hello. Thanks for information. I will try it. |
|||||||||||
|
Re: NumLock state |
.3lite
|
I will bump this thread since it's definitely a bug in SDL2.
We have no way of knowing the real state of the numlock state, so basically if it's off then SDL2 is generating both SDL_TEXTINPUT and SDL_KEYDOWN events resulting in typing the text and navigating around (if numpad is used as arrow keys). However, only SDL_KEYDOWN events are send when the numlock is enabled. It is impossible to check the numlock state by using SDL_GetModState since it's always false when the application is started (even though the numpad is actually on). |
|||||||||||
|