Windows: resync num/caps lock when window is gaining focus.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Dec 2015 13:08:19 -0500
changeset 9974 05770dc93c95
parent 9973 4d8a561cf978
child 9975 bb853b9549d0
Windows: resync num/caps lock when window is gaining focus.
src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Mon Dec 28 13:07:44 2015 -0500
+++ b/src/video/windows/SDL_windowsevents.c	Mon Dec 28 13:08:19 2015 -0500
@@ -415,6 +415,9 @@
                  * 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);