Commit 37db87ef authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

user32: Don't translate control codes when alt is pressed.

parent 95d8f40f
...@@ -880,7 +880,7 @@ INT WINAPI ToUnicode(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, ...@@ -880,7 +880,7 @@ INT WINAPI ToUnicode(UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
WCHAR *str, int size, UINT flags, HKL layout ) WCHAR *str, int size, UINT flags, HKL layout )
{ {
BOOL shift, ctrl, numlock; BOOL shift, ctrl, alt, numlock;
WCHAR buffer[2]; WCHAR buffer[2];
INT len; INT len;
...@@ -890,6 +890,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, ...@@ -890,6 +890,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
if (!state) return 0; if (!state) return 0;
if ((len = USER_Driver->pToUnicodeEx( virt, scan, state, str, size, flags, layout )) >= -1) return len; if ((len = USER_Driver->pToUnicodeEx( virt, scan, state, str, size, flags, layout )) >= -1) return len;
alt = state[VK_MENU] & 0x80;
shift = state[VK_SHIFT] & 0x80; shift = state[VK_SHIFT] & 0x80;
ctrl = state[VK_CONTROL] & 0x80; ctrl = state[VK_CONTROL] & 0x80;
numlock = state[VK_NUMLOCK] & 0x01; numlock = state[VK_NUMLOCK] & 0x01;
...@@ -934,7 +935,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, ...@@ -934,7 +935,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
break; break;
} }
} }
else /* Control codes */ else if (!alt) /* Control codes */
{ {
switch (virt) switch (virt)
{ {
...@@ -948,6 +949,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, ...@@ -948,6 +949,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
break; break;
} }
} }
else buffer[0] = 0;
buffer[1] = 0; buffer[1] = 0;
len = wcslen( buffer ); len = wcslen( buffer );
lstrcpynW( str, buffer, size ); lstrcpynW( str, buffer, size );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment