mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-21 15:55:34 +02:00
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:
@@ -106,13 +106,7 @@ void WIN_UpdateKeymap(SDL_bool send_event)
|
||||
/* Make sure this scancode is a valid character scancode */
|
||||
scancode = windows_scancode_table[i];
|
||||
if (scancode == SDL_SCANCODE_UNKNOWN ||
|
||||
(SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If this key is one of the non-mappable keys, ignore it */
|
||||
/* Uncomment the second part to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */
|
||||
if (scancode == SDL_SCANCODE_DELETE /*|| scancode == SDL_SCANCODE_GRAVE*/) {
|
||||
scancode >= SDL_SCANCODE_CAPSLOCK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user