Added numlock support
authorSam Lantinga
Sun, 30 Jul 2006 06:11:24 +0000
changeset 1960118daa3a24cc
parent 1959 25d6537feea4
child 1961 f42f10fc309e
Added numlock support
src/video/cocoa/SDL_cocoakeyboard.h
src/video/cocoa/SDL_cocoakeyboard.m
     1.1 --- a/src/video/cocoa/SDL_cocoakeyboard.h	Sun Jul 30 05:18:33 2006 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoakeyboard.h	Sun Jul 30 06:11:24 2006 +0000
     1.3 @@ -25,6 +25,7 @@
     1.4  #define _SDL_cocoakeyboard_h
     1.5  
     1.6  extern void Cocoa_InitKeyboard(_THIS);
     1.7 +extern void Cocoa_HandleKeyEvent(_THIS, NSEvent *event);
     1.8  extern void Cocoa_QuitKeyboard(_THIS);
     1.9  
    1.10  #endif /* _SDL_cocoakeyboard_h */
     2.1 --- a/src/video/cocoa/SDL_cocoakeyboard.m	Sun Jul 30 05:18:33 2006 +0000
     2.2 +++ b/src/video/cocoa/SDL_cocoakeyboard.m	Sun Jul 30 06:11:24 2006 +0000
     2.3 @@ -423,6 +423,14 @@
     2.4          SDL_SendKeyboardKey(keyboard, SDL_PRESSED, (Uint8)scancode, SDLK_CAPSLOCK);
     2.5          SDL_SendKeyboardKey(keyboard, SDL_RELEASED, (Uint8)scancode, SDLK_CAPSLOCK);
     2.6      }
     2.7 +
     2.8 +    oldMask = oldMods & NSNumericPadKeyMask;
     2.9 +    newMask = newMods & NSNumericPadKeyMask;
    2.10 +
    2.11 +    if (oldMask != newMask) {
    2.12 +        SDL_SendKeyboardKey(keyboard, SDL_PRESSED, (Uint8)scancode, SDLK_NUMLOCK);
    2.13 +        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, (Uint8)scancode, SDLK_NUMLOCK);
    2.14 +    }
    2.15  }
    2.16  
    2.17  /* This function will handle the modifier keys and also determine the