Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 4f0be6be3f2..13506cf6fc7 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -881,7 +881,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, WCHAR *str, int size, UINT flags, HKL layout ) { static HKL us_layout = (HKL)MAKELONG(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)); - BOOL shift, ctrl, numlock; + BOOL shift, ctrl, alt, numlock; WCHAR buffer[2]; INT len;
@@ -890,6 +890,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
if (!state) return 0;
+ alt = state[VK_MENU] & 0x80; shift = state[VK_SHIFT] & 0x80; ctrl = state[VK_CONTROL] & 0x80; numlock = state[VK_NUMLOCK] & 0x01; @@ -933,7 +934,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, break; } } - else /* Control codes */ + else if (!alt) /* Control codes */ { switch (virt) { @@ -947,6 +948,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, break; } } + else buffer[0] = 0; buffer[1] = 0;
wcsncpy( str, buffer, size );