Skip to content

Commit

Permalink
Merge pull request #25259 from marcelofg55/captured_alt_f4
Browse files Browse the repository at this point in the history
Fix ALT+F4 being ignored with MOUSE_MODE_CAPTURED on Windows
  • Loading branch information
akien-mga authored Jan 23, 2019
2 parents 3551e34 + daf57bc commit 2c9536b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions platform/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2c9536b

Please sign in to comment.