Index: src/video/windib/SDL_dibevents.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/windib/SDL_dibevents.c,v retrieving revision 1.46 diff -u -r1.46 SDL_dibevents.c --- src/video/windib/SDL_dibevents.c 14 Mar 2006 07:06:05 -0000 1.46 +++ src/video/windib/SDL_dibevents.c 14 Mar 2006 20:44:28 -0000 @@ -383,9 +383,32 @@ static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed) { + static SDLKey previous_sym; + /* Set the keysym information */ keysym->scancode = (unsigned char) scancode; - keysym->sym = VK_keymap[vkey]; + + if (pressed) { + HKL hLayout = LoadKeyboardLayout("00000409", 0); + int index; + + if (!hLayout) { + hLayout = GetKeyboardLayout(0); + } + index = MapVirtualKeyEx(scancode, 3, hLayout); + if (!index) { + index = MapVirtualKeyEx(scancode, 1, hLayout); + if (!index) { + index = vkey; + } + } + previous_sym = keysym->sym = VK_keymap[index]; + UnloadKeyboardLayout(hLayout); + } + else { + keysym->sym = previous_sym; + } + keysym->mod = KMOD_NONE; keysym->unicode = 0; if ( pressed && SDL_TranslateUNICODE ) {