Mercurial > sdl-ios-xcode
diff src/video/cocoa/SDL_cocoakeyboard.m @ 1960:118daa3a24cc
Added numlock support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 30 Jul 2006 06:11:24 +0000 |
parents | 25d6537feea4 |
children | f42f10fc309e |
line wrap: on
line diff
--- 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