summaryrefslogtreecommitdiff
path: root/src/video/windows/SDL_windowswindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/windows/SDL_windowswindow.c')
-rw-r--r--src/video/windows/SDL_windowswindow.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c
index 6eb26ebc7..95ceaf993 100644
--- a/src/video/windows/SDL_windowswindow.c
+++ b/src/video/windows/SDL_windowswindow.c
@@ -759,6 +759,11 @@ static void WIN_GrabKeyboard(SDL_Window *window)
return;
}
+ /* Capture a snapshot of the current keyboard state before the hook */
+ if (!GetKeyboardState(data->videodata->pre_hook_key_state)) {
+ return;
+ }
+
/* To grab the keyboard, we have to install a low-level keyboard hook to
intercept keys that would normally be captured by the OS. Intercepting
all key events on the system is rather invasive, but it's what Microsoft