/* Make sure the alpha scancodes are correct. T isn't usually remapped */
if (MapVirtualKey('T', MAPVK_VK_TO_VSC) != alpha_scancodes['T' - 'A']) {
#if0
printf
("Fixing alpha scancode map, assuming US QWERTY layout!\nPlease send the following 26 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n");
#endif
for (i = 0; i < SDL_arraysize(alpha_scancodes); ++i) {
alpha_scancodes[i] = MapVirtualKey('A' + i, MAPVK_VK_TO_VSC);
#if0
printf("%d = %d\n", i, alpha_scancodes[i]);
#endif
}
}
if (MapVirtualKey(VK_NUMPAD0, MAPVK_VK_TO_VSC) != keypad_scancodes[0]) {
#if0
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");
#endif
for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
keypad_scancodes[i] =
MapVirtualKey(VK_NUMPAD0 + i, MAPVK_VK_TO_VSC);
#if0
printf("%d = %d\n", i, keypad_scancodes[i]);
#endif
}
}
// windows scancode to SDL scancode table
data->key_layout = windows_scancode_table;
data->ime_com_initialized = SDL_FALSE;
data->ime_threadmgr = 0;
@@ -151,42 +111,36 @@ WIN_UpdateKeymap()
SDL_Scancode scancode;
SDL_Keycode keymap[SDL_NUM_SCANCODES];
for (i = 0; i < SDL_arraysize(keymap); ++i)
{
keymap[i] = SDL_SCANCODE_TO_KEYCODE( i );
}
SDL_GetDefaultKeymap(keymap);
for (i = 0; i < SDL_arraysize(windows_scancode_table); i++) {
int vk;
int vk;
/* Make sure this scancode is a valid character scancode */
scancode = windows_scancode_table[i];
if (scancode == SDL_SCANCODE_UNKNOWN ) {
continue;
}
/* Don't allow the number keys right above the qwerty row to translate or the top left key (grave/backquote) */
/* not mapping numbers fixes the AZERTY layout (french) causing non-shifted number to appear by default */