PCem
changeset 145:34376c2f2d17
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.
| author | TomW |
|---|---|
| date | Sun Aug 17 15:23:26 2014 +0100 |
| parents | 26a55112027e |
| children | 21f926f1fabf |
| files | src/win.c |
| diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/src/win.c Sat Aug 16 21:19:02 2014 +0100 1.2 +++ b/src/win.c Sun Aug 17 15:23:26 2014 +0100 1.3 @@ -444,7 +444,7 @@ 1.4 memset(rawinputkey, 0, sizeof(rawinputkey)); 1.5 device.usUsagePage = 0x01; 1.6 device.usUsage = 0x06; 1.7 - device.dwFlags = 0; 1.8 + device.dwFlags = RIDEV_NOHOTKEYS; 1.9 device.hwndTarget = hwnd; 1.10 1.11 if (RegisterRawInputDevices(&device, 1, sizeof(device))) 1.12 @@ -909,6 +909,9 @@ 1.13 UINT size; 1.14 RAWINPUT *raw; 1.15 1.16 + if (!infocus) 1.17 + break; 1.18 + 1.19 GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER)); 1.20 1.21 raw = malloc(size); 1.22 @@ -968,6 +971,7 @@ 1.23 mousecapture=0; 1.24 } 1.25 // pclog("Lost focus!\n"); 1.26 + memset(rawinputkey, 0, sizeof(rawinputkey)); 1.27 break; 1.28 1.29 case WM_LBUTTONUP:
