Rémi Bernon : user32: Don't translate control codes when alt is pressed.

Alexandre Julliard julliard at winehq.org
Thu Apr 29 16:38:30 CDT 2021


Module: wine
Branch: master
Commit: 37db87eff68e0fdc8397852e327797a12f17d24c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=37db87eff68e0fdc8397852e327797a12f17d24c

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Apr 29 09:53:53 2021 +0200

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

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 24942f72aa1..a79f80ed190 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -880,7 +880,7 @@ INT WINAPI ToUnicode(UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
 INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
                         WCHAR *str, int size, UINT flags, HKL layout )
 {
-    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;
     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;
     ctrl = state[VK_CONTROL] & 0x80;
     numlock = state[VK_NUMLOCK] & 0x01;
@@ -934,7 +935,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
             break;
         }
     }
-    else /* Control codes */
+    else if (!alt) /* Control codes */
     {
         switch (virt)
         {
@@ -948,6 +949,7 @@ INT WINAPI ToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
             break;
         }
     }
+    else buffer[0] = 0;
     buffer[1] = 0;
     len = wcslen( buffer );
     lstrcpynW( str, buffer, size );




More information about the wine-cvs mailing list