# HG changeset patch # User Sam Lantinga # Date 1264569262 0 # Node ID 076c12750bc492dce5f6222374c1588eb0198b90 # Parent 4160ba33b597530047a88170cabe68b290d3fe75 Fixed bug #743 The arrow keys and keypad arrow keys have almost the same scancodes! diff -r 4160ba33b597 -r 076c12750bc4 src/video/win32/SDL_vkeys.h --- a/src/video/win32/SDL_vkeys.h Tue Jan 26 06:01:33 2010 +0000 +++ b/src/video/win32/SDL_vkeys.h Wed Jan 27 05:14:22 2010 +0000 @@ -73,4 +73,5 @@ #define VK_APOSTROPHE 0xDE #define VK_BACKTICK 0xDF #define VK_OEM_102 0xE2 + /* vi: set ts=4 sw=4 expandtab: */ diff -r 4160ba33b597 -r 076c12750bc4 src/video/win32/SDL_win32events.c --- a/src/video/win32/SDL_win32events.c Tue Jan 26 06:01:33 2010 +0000 +++ b/src/video/win32/SDL_win32events.c Wed Jan 27 05:14:22 2010 +0000 @@ -84,11 +84,16 @@ } } - /* Keypad keys are a little trickier, we always scan for them. */ - for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { - if (scancode == keypad_scancodes[i]) { - wParam = VK_NUMPAD0 + i; - break; + /* 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) { + if (scancode == keypad_scancodes[i]) { + wParam = VK_NUMPAD0 + i; + break; + } } }