Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)

Fixes https://github.com/libsdl-org/SDL/pull/5127

(cherry picked from commit a2f4783e75)
This commit is contained in:
Sam Lantinga
2023-05-22 11:30:42 -07:00
parent 376a3cd100
commit 4dd9f61bfd
3 changed files with 30 additions and 11 deletions

View File

@@ -130,10 +130,8 @@ void WIN_UpdateKeymap(SDL_bool send_event)
}
/* If this key is one of the non-mappable keys, ignore it */
/* Not mapping numbers fixes the French layout, giving numeric keycodes for the number keys, which is the expected behavior */
if ((keymap[scancode] & SDLK_SCANCODE_MASK) ||
/* scancode == SDL_SCANCODE_GRAVE || */ /* Uncomment this line to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */
(scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0)) {
/* Uncomment the second part re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */
if ((keymap[scancode] & SDLK_SCANCODE_MASK) /*|| scancode == SDL_SCANCODE_GRAVE*/) {
continue;
}