Numlock & pause fix from Alfred.
authorJørgen P. Tjernø <jorgen@valvesoftware.com>
Wed, 10 Apr 2013 14:11:26 -0700
changeset 7060 9d96148c2e3e
parent 7059 cd194e03c1da
child 7061 45df4552bdfe
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
--- a/src/video/windows/SDL_windowsevents.c	Mon Apr 08 18:37:50 2013 -0400
+++ b/src/video/windows/SDL_windowsevents.c	Wed Apr 10 14:11:26 2013 -0700
@@ -73,7 +73,8 @@
 	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 @@
 		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;