Quartz code should use F13, F14, and F15 keys instead of PrintScreen, SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Wed, 14 Feb 2007 10:23:23 +0000
branchSDL-1.2
changeset 39144fd12011d8d6
parent 3913 9e454eb693a5
child 3915 89b0f3d12fe2
Quartz code should use F13, F14, and F15 keys instead of PrintScreen,
ScrollLock, and Pause, since that's what's on the standard Apple keyboards
(minus the laptops, which have neither set). Ideally we'll find a better way
to distinguish this...the keys being replaced would be correct on a USB
keyboard for Windows. Sigh.

Fixes Bugzilla #301.
src/video/quartz/SDL_QuartzEvents.m
src/video/quartz/SDL_QuartzKeys.h
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Tue Feb 13 09:58:04 2007 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Wed Feb 14 10:23:23 2007 +0000
     1.3 @@ -87,9 +87,14 @@
     1.4      keymap[QZ_F10] = SDLK_F10;
     1.5      keymap[QZ_F11] = SDLK_F11;
     1.6      keymap[QZ_F12] = SDLK_F12;
     1.7 +    keymap[QZ_F13] = SDLK_F13;
     1.8 +    keymap[QZ_F14] = SDLK_F14;
     1.9 +    keymap[QZ_F15] = SDLK_F15;
    1.10 +/*
    1.11      keymap[QZ_PRINT] = SDLK_PRINT;
    1.12      keymap[QZ_SCROLLOCK] = SDLK_SCROLLOCK;
    1.13      keymap[QZ_PAUSE] = SDLK_PAUSE;
    1.14 +*/
    1.15      keymap[QZ_POWER] = SDLK_POWER;
    1.16      keymap[QZ_BACKQUOTE] = SDLK_BACKQUOTE;
    1.17      keymap[QZ_1] = SDLK_1;
    1.18 @@ -270,6 +275,7 @@
    1.19      if (numChars == 0) {
    1.20        
    1.21          key.scancode = [ event keyCode ];
    1.22 +printf("numChars == 0, scancode == %d\n", (int) key.scancode);
    1.23          key.sym      = keymap [ key.scancode ];
    1.24          key.unicode  = 0;
    1.25          key.mod      = KMOD_NONE;
    1.26 @@ -279,6 +285,7 @@
    1.27      else if (numChars == 1) {
    1.28  
    1.29          key.scancode = [ event keyCode ];
    1.30 +printf("numChars == 1, scancode == %d\n", (int) key.scancode);
    1.31          key.sym      = keymap [ key.scancode ];
    1.32          key.unicode  = [ chars characterAtIndex:0 ];
    1.33          key.mod      = KMOD_NONE;
     2.1 --- a/src/video/quartz/SDL_QuartzKeys.h	Tue Feb 13 09:58:04 2007 +0000
     2.2 +++ b/src/video/quartz/SDL_QuartzKeys.h	Wed Feb 14 10:23:23 2007 +0000
     2.3 @@ -36,9 +36,14 @@
     2.4  #define QZ_F10			0x6D
     2.5  #define QZ_F11			0x67
     2.6  #define QZ_F12			0x6F
     2.7 +#define QZ_F13			0x69
     2.8 +#define QZ_F14			0x6B
     2.9 +#define QZ_F15			0x71
    2.10 +/*
    2.11  #define QZ_PRINT		0x69
    2.12  #define QZ_SCROLLOCK    0x6B
    2.13  #define QZ_PAUSE		0x71
    2.14 +*/
    2.15  #define QZ_POWER		0x7F
    2.16  #define QZ_BACKQUOTE	0x32
    2.17  #define QZ_1			0x12