Implement ToAscii() and ToAsciiEx()

svn path=/trunk/; revision=12375
This commit is contained in:
Gé van Geldorp 2004-12-28 08:58:35 +00:00
parent 430c468657
commit 27679de8f1

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c * FILE: lib/user32/windows/input.c
@ -392,7 +392,7 @@ SwapMouseButton(
/* /*
* @unimplemented * @implemented
*/ */
int STDCALL int STDCALL
ToAscii(UINT uVirtKey, ToAscii(UINT uVirtKey,
@ -401,13 +401,12 @@ ToAscii(UINT uVirtKey,
LPWORD lpChar, LPWORD lpChar,
UINT uFlags) UINT uFlags)
{ {
UNIMPLEMENTED; return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
return 0;
} }
/* /*
* @unimplemented * @implemented
*/ */
int STDCALL int STDCALL
ToAsciiEx(UINT uVirtKey, ToAsciiEx(UINT uVirtKey,
@ -417,8 +416,14 @@ ToAsciiEx(UINT uVirtKey,
UINT uFlags, UINT uFlags,
HKL dwhkl) HKL dwhkl)
{ {
UNIMPLEMENTED; WCHAR UniChars[2];
return 0; 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;
} }