]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Added workaround for Wine RawInput keyboard handling
authorfalcon35180 <ned.mustakinov@gmail.com>
Sat, 17 Dec 2022 17:21:59 +0000 (04:21 +1100)
committerfalcon35180 <ned.mustakinov@gmail.com>
Sat, 17 Dec 2022 17:21:59 +0000 (04:21 +1100)
od-win32/dinput.cpp
od-win32/win32.cpp

index e822602f00dcfac292c4596e60b4edd824ecb95f..edc041b81f360432121c2db7cad4fd112761d203 100644 (file)
@@ -17,6 +17,7 @@ int tablet_log = 0;
 int no_rawinput = 0;
 int no_directinput = 0;
 int no_windowsmouse = 0;
+int winekeyboard = 0;
 
 #define _WIN32_WINNT 0x501 /* enable RAWINPUT support */
 
@@ -2470,7 +2471,9 @@ static void handle_rawinput_2 (RAWINPUT *raw, LPARAM lParam)
                                write_log (_T("VK->CODE: %x\n"), scancode);
 
                }
-               if (rk->VKey == 0xff || (rk->Flags & RI_KEY_E0))
+               if (rk->VKey == 0xff || ((rk->Flags & RI_KEY_E0) && !(winekeyboard && rk->VKey == VK_NUMLOCK)))
+                       scancode |= 0x80;
+               if (winekeyboard && rk->VKey == VK_PAUSE)
                        scancode |= 0x80;
                if (rk->MakeCode == KEYBOARD_OVERRUN_MAKE_CODE)
                        return;
index 837102888c2ce1d7a1e64546fb4e2c9100fb4a82..72103dce39db3ad0c1cf74cf5f506de295861c39 100644 (file)
@@ -114,7 +114,7 @@ const static GUID GUID_DEVINTERFACE_MOUSE = { 0x378de44c, 0x56ef, 0x11d1,
 { 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd } };
 
 extern int harddrive_dangerous, do_rdbdump;
-extern int no_rawinput, no_directinput, no_windowsmouse;
+extern int no_rawinput, no_directinput, no_windowsmouse, winekeyboard;
 extern int force_directsound;
 extern int log_a2065, a2065_promiscuous, log_ethernet;
 extern int rawinput_enabled_hid, rawinput_log;
@@ -6429,6 +6429,10 @@ static int parseargs(const TCHAR *argx, const TCHAR *np, const TCHAR *np2)
                no_windowsmouse = 1;
                return 1;
        }
+       if (!_tcscmp(arg, _T("winekeyboard"))) {
+               winekeyboard = 1;
+               return 1;
+       }
        if (!_tcscmp(arg, _T("rawhid"))) {
                rawinput_enabled_hid = 1;
                return 1;