On 4/23/21 7:30 PM, Rémi Bernon wrote:
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 805bfe3e9de..4f0be6be3f2 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -877,11 +877,82 @@ INT WINAPI ToUnicode(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, /****************************************************************************
ToUnicodeEx (USER32.@)
*/ -INT WINAPI ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
LPWSTR lpwStr, int size, UINT flags, HKL hkl)
+INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
{WCHAR *str, int size, UINT flags, HKL layout )
- if (!lpKeyState) return 0;
- return USER_Driver->pToUnicodeEx(virtKey, scanCode, lpKeyState, lpwStr, size, flags, hkl);
- static HKL us_layout = (HKL)MAKELONG(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT));
- BOOL shift, ctrl, numlock;
- WCHAR buffer[2];
- INT len;
- TRACE_(keyboard)( "virt %u, scan %u, state %p, str %p, size %d, flags %x, layout %p.\n",
virt, scan, state, str, size, flags, layout );
- if (!state) return 0;
- shift = state[VK_SHIFT] & 0x80;
- ctrl = state[VK_CONTROL] & 0x80;
- numlock = state[VK_NUMLOCK] & 0x01;
- if (layout != us_layout) buffer[0] = 0; /* FIXME: non-us layout */
I didn't want to pretend to have a default implementation for non-us layouts, but this is also then not equivalent to what the Android driver was doing.
I guess, we should ignore the layout here in the same way wineandroid.drv was doing, and let the driver override non-us layouts if they implement it.