From fd6b435c6ac904b2566d6f86de92c21192a8065b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 28 Dec 2015 13:08:19 -0500 Subject: [PATCH] Windows: resync num/caps lock when window is gaining focus. --- src/video/windows/SDL_windowsevents.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 3ce8291df..cf2e563f8 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -415,6 +415,9 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) * FIXME: Update keyboard state */ WIN_CheckClipboardUpdate(data->videodata); + + SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0); + SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0); } else { if (SDL_GetKeyboardFocus() == data->window) { SDL_SetKeyboardFocus(NULL);