From f2c8d8e9c4a593db7c79a458998a6bd1a9963311 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 8 Jun 2019 10:47:43 -0700 Subject: [PATCH] Fixed bug 4443 - Incorrect scan code reported for numpad 5 bplu4t2f When num lock is on, the scancode reported for numpad 5 is SDL_SCANCODE_KP_5, which is correct. However, when num lock is off, windows reports the VK_CLEAR virtual key code, which is incorrectly translated into SDL_SCANCODE_CLEAR inside of the VKeytoScancode(WPARAM vkey) function. --- src/video/windows/SDL_windowsevents.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 62dd94967..73b2185a0 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -86,7 +86,9 @@ static SDL_Scancode VKeytoScancode(WPARAM vkey) { switch (vkey) { +/* Windows generates this virtual keycode for Keypad 5 when NumLock is off. case VK_CLEAR: return SDL_SCANCODE_CLEAR; +*/ case VK_MODECHANGE: return SDL_SCANCODE_MODE; case VK_SELECT: return SDL_SCANCODE_SELECT; case VK_EXECUTE: return SDL_SCANCODE_EXECUTE;