Skip to content

Commit

Permalink
Windows: resync num/caps lock when window is gaining focus.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 28, 2015
1 parent 257b7af commit fd6b435
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -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);
Expand Down

0 comments on commit fd6b435

Please sign in to comment.