Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Numlock & pause fix from Alfred.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jorgenpt committed Apr 10, 2013
1 parent d71c32b commit a403330
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/windows/SDL_windowsevents.c
Expand Up @@ -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 )
{
Expand All @@ -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;
Expand Down

0 comments on commit a403330

Please sign in to comment.