Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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
  • Loading branch information
jorgenpt committed Apr 10, 2013
1 parent d71c32b commit a4033300b4e6a887c3577f0f034cc11ca2f94460
Showing with 4 additions and 1 deletion.
  1. +4 −1 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;

0 comments on commit a403330

Please sign in to comment.