Numpad scancodes have non-numpad keycodes
This allows the numpad to work as the user expects based on the numlock state. If the application needs to distinguish the keys, it can check to see whether the scancode is a numpad key or not.
This commit is contained in:
parent
78dbf9be50
commit
d4497ecdbd
8 changed files with 316 additions and 352 deletions
|
@ -334,8 +334,8 @@ static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scan
|
|||
{
|
||||
SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) != 0;
|
||||
|
||||
// We won't be applying any modifiers by default
|
||||
modstate = SDL_KMOD_NONE;
|
||||
// We won't be applying any modifiers except numlock by default
|
||||
modstate &= SDL_KMOD_NUM;
|
||||
|
||||
if (scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) {
|
||||
if (keyboard->non_latin_letters && (keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue