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

Commit

Permalink
Added numlock support
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 30, 2006
1 parent f788806 commit 355b021
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/cocoa/SDL_cocoakeyboard.h
Expand Up @@ -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 */
Expand Down
8 changes: 8 additions & 0 deletions src/video/cocoa/SDL_cocoakeyboard.m
Expand Up @@ -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
Expand Down

0 comments on commit 355b021

Please sign in to comment.