Commit 7bf66f35 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #743

The arrow keys and keypad arrow keys have almost the same scancodes!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404456
parent edb47734
...@@ -73,4 +73,5 @@ ...@@ -73,4 +73,5 @@
#define VK_APOSTROPHE 0xDE #define VK_APOSTROPHE 0xDE
#define VK_BACKTICK 0xDF #define VK_BACKTICK 0xDF
#define VK_OEM_102 0xE2 #define VK_OEM_102 0xE2
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
...@@ -84,13 +84,18 @@ RemapVKEY(WPARAM wParam, LPARAM lParam) ...@@ -84,13 +84,18 @@ RemapVKEY(WPARAM wParam, LPARAM lParam)
} }
} }
/* Keypad keys are a little trickier, we always scan for them. */ /* Keypad keys are a little trickier, we always scan for them.
Keypad arrow keys have the same scancode as normal arrow keys,
except they don't have the extended bit (0x1000000) set.
*/
if (!(lParam & 0x1000000)) {
for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
if (scancode == keypad_scancodes[i]) { if (scancode == keypad_scancodes[i]) {
wParam = VK_NUMPAD0 + i; wParam = VK_NUMPAD0 + i;
break; break;
} }
} }
}
return wParam; return wParam;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment