Mercurial > sdl-ios-xcode
diff src/video/win32/SDL_win32keyboard.c @ 2317:f537a293b3da
Windows also remaps the numeric keypad... grrr
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 11 Feb 2008 21:06:32 +0000 |
parents | 54e21acfec5a |
children | 3202e4826c57 |
line wrap: on
line diff
--- a/src/video/win32/SDL_win32keyboard.c Mon Feb 11 20:26:22 2008 +0000 +++ b/src/video/win32/SDL_win32keyboard.c Mon Feb 11 21:06:32 2008 +0000 @@ -41,6 +41,9 @@ 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44 }; +BYTE keypad_scancodes[10] = { + 82, 79, 80, 81, 75, 76, 77, 71, 72, 73 +}; void WIN_InitKeyboard(_THIS) @@ -57,6 +60,13 @@ printf("%d = %d\n", i, alpha_scancodes[i]); } } + if (MapVirtualKey(VK_NUMPAD0, MAPVK_VK_TO_VSC) != keypad_scancodes[0]) { +printf("Fixing keypad scancode map!\nPlease send the following 10 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n"); + for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { + keypad_scancodes[i] = MapVirtualKey(VK_NUMPAD0+i, MAPVK_VK_TO_VSC); +printf("%d = %d\n", i, keypad_scancodes[i]); + } + } data->key_layout = win32_scancode_table;