[PATCH v3 3/4] wineandroid: Set the scan code prefix when necessary.

Derek Lesho dlesho at codeweavers.com
Tue Nov 12 14:50:18 CST 2019


Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
 dlls/wineandroid.drv/keyboard.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c
index 2c37c42e0d..a07e4c6ac2 100644
--- a/dlls/wineandroid.drv/keyboard.c
+++ b/dlls/wineandroid.drv/keyboard.c
@@ -909,7 +909,7 @@ INT CDECL ANDROID_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
  */
 UINT CDECL ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl )
 {
-    UINT ret = 0;
+    UINT ret = 0, prefix = 0;
     const char *s;
 
     TRACE_(key)( "code=0x%x, maptype=%d, hkl %p\n", code, maptype, hkl );
@@ -932,6 +932,13 @@ UINT CDECL ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl )
             break;
         }
         if (code < ARRAY_SIZE( vkey_to_scancode )) ret = vkey_to_scancode[code];
+
+        /* set scan code prefix */
+        if (code == VK_RCONTROL || code == VK_RMENU)
+            prefix = 0xE0;
+
+        if (maptype == MAPVK_VK_TO_VSC_EX)
+            ret |= ((prefix << 8) & 0xFF00);
         break;
     case MAPVK_VSC_TO_VK:
     case MAPVK_VSC_TO_VK_EX:
-- 
2.23.0




More information about the wine-devel mailing list