# HG changeset patch # User TomW # Date 1408285406 -3600 # Node ID 34376c2f2d17913a3938d72fab17386cd0095dd3 # Parent 26a55112027e83aa6143dd3edb672a58a17e3f80 Disable keyboard input when main window out of focus - entry into dialogs no longer picked up by emulator. Set RIDEV_NOHOTKEYS when registering raw input devices - Windows key and some other shortcuts no longer affect emulator. diff -r 26a55112027e -r 34376c2f2d17 src/win.c --- a/src/win.c Sat Aug 16 21:19:02 2014 +0100 +++ b/src/win.c Sun Aug 17 15:23:26 2014 +0100 @@ -444,7 +444,7 @@ memset(rawinputkey, 0, sizeof(rawinputkey)); device.usUsagePage = 0x01; device.usUsage = 0x06; - device.dwFlags = 0; + device.dwFlags = RIDEV_NOHOTKEYS; device.hwndTarget = hwnd; if (RegisterRawInputDevices(&device, 1, sizeof(device))) @@ -909,6 +909,9 @@ UINT size; RAWINPUT *raw; + if (!infocus) + break; + GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER)); raw = malloc(size); @@ -968,6 +971,7 @@ mousecapture=0; } // pclog("Lost focus!\n"); + memset(rawinputkey, 0, sizeof(rawinputkey)); break; case WM_LBUTTONUP: