summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <huth@tuxfamily.org>2019-04-25 05:26:49 (GMT)
committerThomas Huth <huth@tuxfamily.org>2019-04-25 05:26:49 (GMT)
commitf07bc3ad4f25a908dcff41e1090aaa11f7d6d40e (patch)
tree3a8e39c137bdcfe74ba4092772c1c6965ceacf5a
parent093724ae6f1649ab846ff7ea35dcdbe94a94dac9 (diff)
downloadhatari-f07bc3ad4f25a908dcff41e1090aaa11f7d6d40e.zip
hatari-f07bc3ad4f25a908dcff41e1090aaa11f7d6d40e.tar.gz
Fix keypad emulation with SDL2
SDLK_KP_0 has a higher value than SDLK_KP_9 on SDL2, so the Keymap_GetKeyPadScanCode() was never called. Change the check to use SDLK_KP_1 instead to fix the issue.
-rw-r--r--src/keymap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 7dccf96..9c358ce 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -531,7 +531,6 @@ static char Keymap_GetKeyPadScanCode(SDL_keysym* pKeySym)
{
switch (pKeySym->sym)
{
- case SDLK_KP0: return 0x70; /* NumPad 0 */
case SDLK_KP1: return 0x6d; /* NumPad 1 */
case SDLK_KP2: return 0x6e; /* NumPad 2 */
case SDLK_KP3: return 0x6f; /* NumPad 3 */
@@ -548,7 +547,6 @@ static char Keymap_GetKeyPadScanCode(SDL_keysym* pKeySym)
{
switch (pKeySym->sym)
{
- case SDLK_KP0: return 0x70; /* NumPad 0 */
case SDLK_KP1: return 0x6d; /* NumPad 1 */
case SDLK_KP2: return 0x50; /* Cursor down */
case SDLK_KP3: return 0x6f; /* NumPad 3 */
@@ -574,7 +572,7 @@ static char Keymap_RemapKeyToSTScanCode(SDL_keysym* pKeySym)
/* Check for keypad first so we can handle numlock */
if (ConfigureParams.Keyboard.nKeymapType != KEYMAP_LOADED)
{
- if (pKeySym->sym >= SDLK_KP0 && pKeySym->sym <= SDLK_KP9)
+ if (pKeySym->sym >= SDLK_KP1 && pKeySym->sym <= SDLK_KP9)
{
return Keymap_GetKeyPadScanCode(pKeySym);
}