From a4033300b4e6a887c3577f0f034cc11ca2f94460 Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Wed, 10 Apr 2013 14:11:26 -0700 Subject: [PATCH] Numlock & pause fix from Alfred. Fix numlock and pause keys not being pressable on win32, they both report under the same scancode, so use the VK to tell them apart --- src/video/windows/SDL_windowsevents.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 730e73766..fc85e4493 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -73,7 +73,8 @@ WindowsScanCodeToSDLScanCode( LPARAM lParam, WPARAM wParam ) char bIsExtended; int nScanCode = ( lParam >> 16 ) & 0xFF; - if ( nScanCode == 0 ) + /* 0x45 here to work around both pause and numlock sharing the same scancode, so use the VK key to tell them apart */ + if ( nScanCode == 0 || nScanCode == 0x45 ) { switch( wParam ) { @@ -82,6 +83,8 @@ WindowsScanCodeToSDLScanCode( LPARAM lParam, WPARAM wParam ) case VK_SELECT: return SDL_SCANCODE_SELECT; case VK_EXECUTE: return SDL_SCANCODE_EXECUTE; case VK_HELP: return SDL_SCANCODE_HELP; + case VK_PAUSE: return SDL_SCANCODE_PAUSE; + case VK_NUMLOCK: return SDL_SCANCODE_NUMLOCKCLEAR; case VK_F13: return SDL_SCANCODE_F13; case VK_F14: return SDL_SCANCODE_F14;