diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-01-23 15:41:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-23 15:41:31 +0100 |
commit | 2c9536b655d006c697a3cf830ad3352f1a1ed9f2 (patch) | |
tree | 8366071b787b25afbb5cc832d680b45a7a627698 | |
parent | 3551e3478a7a7d99ea5ecddabf619c38de8a4915 (diff) | |
parent | daf57bc81f44160103279c5c476e8a1c86563e4d (diff) |
Merge pull request #25259 from marcelofg55/captured_alt_f4
Fix ALT+F4 being ignored with MOUSE_MODE_CAPTURED on Windows
-rw-r--r-- | platform/windows/os_windows.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 5cba34ac62..35f9d541ef 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -805,6 +805,13 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) gr_mem = alt_mem; } + if (mouse_mode == MOUSE_MODE_CAPTURED) { + // When SetCapture is used, ALT+F4 hotkey is ignored by Windows, so handle it ourselves + if (wParam == VK_F4 && alt_mem && (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN)) { + if (main_loop) + main_loop->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST); + } + } /* if (wParam==VK_WIN) TODO wtf is this? meta_mem=uMsg==WM_KEYDOWN; |