From 2793c9cfb0af642aabf0f83700a84e441b2ca035 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 25 Jan 2021 18:40:26 -0600 Subject: [PATCH] Fix grabbing Alt+Tab and Alt+Esc on Windows 7 --- src/video/windows/SDL_windowsevents.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index ef6403189..87878dd73 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -457,6 +457,15 @@ WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) case VK_RCONTROL: scanCode = SDL_SCANCODE_RCTRL; break; + + /* These are required to intercept Alt+Tab and Alt+Esc on Windows 7 */ + case VK_TAB: + scanCode = SDL_SCANCODE_TAB; + break; + case VK_ESCAPE: + scanCode = SDL_SCANCODE_ESCAPE; + break; + default: return CallNextHookEx(NULL, nCode, wParam, lParam); }