From a11712b6513162ebfbdd82a325b5609e6bcd4d00 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 31 Dec 2024 03:27:21 +0100 Subject: [PATCH] Make the hook only run if it's either captured or full screen. --- src/qt/qt_main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 603099e68..1c4a932c7 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -151,6 +151,9 @@ emu_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) BOOL bCtrlDown = GetAsyncKeyState (VK_CONTROL) >> ((sizeof(SHORT) * 8) - 1); uint16_t scancode = lpKdhs->scanCode & 0x00ff; + if ((nCode < 0) || (nCode != HC_ACTION) || (!mouse_capture && !video_fullscreen)) + return CallNextHookEx(NULL, nCode, wParam, lParam); + if (lpKdhs->flags & LLKHF_EXTENDED) scancode |= 0x100;