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

Added numlock support

  • Loading branch information
slouken committed Jul 30, 2006
1 parent f788806 commit 355b021b73e3eef0b48cfe600cc6b0c9d2c7a984
Showing with 9 additions and 0 deletions.
  1. +1 −0 src/video/cocoa/SDL_cocoakeyboard.h
  2. +8 −0 src/video/cocoa/SDL_cocoakeyboard.m
@@ -25,6 +25,7 @@
#define _SDL_cocoakeyboard_h

extern void Cocoa_InitKeyboard(_THIS);
extern void Cocoa_HandleKeyEvent(_THIS, NSEvent *event);
extern void Cocoa_QuitKeyboard(_THIS);

#endif /* _SDL_cocoakeyboard_h */
@@ -423,6 +423,14 @@
SDL_SendKeyboardKey(keyboard, SDL_PRESSED, (Uint8)scancode, SDLK_CAPSLOCK);
SDL_SendKeyboardKey(keyboard, SDL_RELEASED, (Uint8)scancode, SDLK_CAPSLOCK);
}

oldMask = oldMods & NSNumericPadKeyMask;
newMask = newMods & NSNumericPadKeyMask;

if (oldMask != newMask) {
SDL_SendKeyboardKey(keyboard, SDL_PRESSED, (Uint8)scancode, SDLK_NUMLOCK);
SDL_SendKeyboardKey(keyboard, SDL_RELEASED, (Uint8)scancode, SDLK_NUMLOCK);
}
}

/* This function will handle the modifier keys and also determine the

0 comments on commit 355b021

Please sign in to comment.