Mercurial > sdl-ios-xcode
diff src/video/windx5/SDL_dx5events.c @ 1253:7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
This is a collaborative effort between Alex Volkov and John Popplewell.
Thanks guys! (Fixes bug #39)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 19 Jan 2006 09:09:32 +0000 |
parents | 040aa1bea9fc |
children | f61f045343d3 |
line wrap: on
line diff
--- a/src/video/windx5/SDL_dx5events.c Thu Jan 19 08:53:12 2006 +0000 +++ b/src/video/windx5/SDL_dx5events.c Thu Jan 19 09:09:32 2006 +0000 @@ -824,11 +824,11 @@ keysym->sym = DIK_keymap[scancode]; keysym->mod = KMOD_NONE; keysym->unicode = 0; - if ( pressed && SDL_TranslateUNICODE ) { /* Someday use ToUnicode() */ + if ( pressed && SDL_TranslateUNICODE ) { UINT vkey; #ifndef NO_GETKEYBOARDSTATE - BYTE keystate[256]; - BYTE chars[2]; + BYTE keystate[256]; + Uint16 wchars[2]; #endif vkey = MapVirtualKey(scancode, 1); @@ -837,10 +837,11 @@ keysym->unicode = vkey; #else GetKeyboardState(keystate); - if ( ToAscii(vkey,scancode,keystate,(WORD *)chars,0) == 1 ) { - keysym->unicode = chars[0]; + if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1) + { + keysym->unicode = wchars[0]; } -#endif +#endif /* NO_GETKEYBOARDSTATE */ } return(keysym); }