diff --git a/reactos/lib/user32/windows/input.c b/reactos/lib/user32/windows/input.c index 208fee44a23..89625388069 100644 --- a/reactos/lib/user32/windows/input.c +++ b/reactos/lib/user32/windows/input.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: input.c,v 1.26 2004/12/11 18:43:06 sedwards Exp $ +/* $Id: input.c,v 1.27 2004/12/28 08:58:35 gvg Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -392,7 +392,7 @@ SwapMouseButton( /* - * @unimplemented + * @implemented */ int STDCALL ToAscii(UINT uVirtKey, @@ -401,13 +401,12 @@ ToAscii(UINT uVirtKey, LPWORD lpChar, UINT uFlags) { - UNIMPLEMENTED; - return 0; + return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0); } /* - * @unimplemented + * @implemented */ int STDCALL ToAsciiEx(UINT uVirtKey, @@ -417,8 +416,14 @@ ToAsciiEx(UINT uVirtKey, UINT uFlags, HKL dwhkl) { - UNIMPLEMENTED; - return 0; + WCHAR UniChars[2]; + int Ret, CharCount; + + Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl); + CharCount = (Ret < 0 ? 1 : Ret); + WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR) lpChar, 2, NULL, NULL); + + return Ret; }