Added KMOD_SCROLL to track the scroll lock state

Fixes https://github.com/libsdl-org/SDL/issues/4566
This commit is contained in:
Sam Lantinga
2021-08-10 17:50:17 -07:00
parent 609cea1eb8
commit cb1e20b058
8 changed files with 38 additions and 2 deletions

View File

@@ -627,6 +627,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0);
SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0);
SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) != 0);
} else {
RECT rect;

View File

@@ -106,6 +106,7 @@ WIN_InitKeyboard(_THIS)
/* Are system caps/num/scroll lock active? Set our state to match. */
SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0);
SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0);
SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) != 0);
}
void