# HG changeset patch # User Sam Lantinga # Date 1154239884 0 # Node ID 118daa3a24ccd8f507ac031dba3e3c6d62ad16e9 # Parent 25d6537feea4930585e40e0fe90355ea8d74ca8a Added numlock support diff -r 25d6537feea4 -r 118daa3a24cc src/video/cocoa/SDL_cocoakeyboard.h --- a/src/video/cocoa/SDL_cocoakeyboard.h Sun Jul 30 05:18:33 2006 +0000 +++ b/src/video/cocoa/SDL_cocoakeyboard.h Sun Jul 30 06:11:24 2006 +0000 @@ -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 */ diff -r 25d6537feea4 -r 118daa3a24cc src/video/cocoa/SDL_cocoakeyboard.m --- a/src/video/cocoa/SDL_cocoakeyboard.m Sun Jul 30 05:18:33 2006 +0000 +++ b/src/video/cocoa/SDL_cocoakeyboard.m Sun Jul 30 06:11:24 2006 +0000 @@ -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