Commit b360c133 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402267
parent 64941faf
...@@ -87,9 +87,14 @@ void QZ_InitOSKeymap (_THIS) { ...@@ -87,9 +87,14 @@ void QZ_InitOSKeymap (_THIS) {
keymap[QZ_F10] = SDLK_F10; keymap[QZ_F10] = SDLK_F10;
keymap[QZ_F11] = SDLK_F11; keymap[QZ_F11] = SDLK_F11;
keymap[QZ_F12] = SDLK_F12; keymap[QZ_F12] = SDLK_F12;
keymap[QZ_F13] = SDLK_F13;
keymap[QZ_F14] = SDLK_F14;
keymap[QZ_F15] = SDLK_F15;
/*
keymap[QZ_PRINT] = SDLK_PRINT; keymap[QZ_PRINT] = SDLK_PRINT;
keymap[QZ_SCROLLOCK] = SDLK_SCROLLOCK; keymap[QZ_SCROLLOCK] = SDLK_SCROLLOCK;
keymap[QZ_PAUSE] = SDLK_PAUSE; keymap[QZ_PAUSE] = SDLK_PAUSE;
*/
keymap[QZ_POWER] = SDLK_POWER; keymap[QZ_POWER] = SDLK_POWER;
keymap[QZ_BACKQUOTE] = SDLK_BACKQUOTE; keymap[QZ_BACKQUOTE] = SDLK_BACKQUOTE;
keymap[QZ_1] = SDLK_1; keymap[QZ_1] = SDLK_1;
...@@ -270,6 +275,7 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) { ...@@ -270,6 +275,7 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) {
if (numChars == 0) { if (numChars == 0) {
key.scancode = [ event keyCode ]; key.scancode = [ event keyCode ];
printf("numChars == 0, scancode == %d\n", (int) key.scancode);
key.sym = keymap [ key.scancode ]; key.sym = keymap [ key.scancode ];
key.unicode = 0; key.unicode = 0;
key.mod = KMOD_NONE; key.mod = KMOD_NONE;
...@@ -279,6 +285,7 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) { ...@@ -279,6 +285,7 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) {
else if (numChars == 1) { else if (numChars == 1) {
key.scancode = [ event keyCode ]; key.scancode = [ event keyCode ];
printf("numChars == 1, scancode == %d\n", (int) key.scancode);
key.sym = keymap [ key.scancode ]; key.sym = keymap [ key.scancode ];
key.unicode = [ chars characterAtIndex:0 ]; key.unicode = [ chars characterAtIndex:0 ];
key.mod = KMOD_NONE; key.mod = KMOD_NONE;
......
...@@ -36,9 +36,14 @@ ...@@ -36,9 +36,14 @@
#define QZ_F10 0x6D #define QZ_F10 0x6D
#define QZ_F11 0x67 #define QZ_F11 0x67
#define QZ_F12 0x6F #define QZ_F12 0x6F
#define QZ_F13 0x69
#define QZ_F14 0x6B
#define QZ_F15 0x71
/*
#define QZ_PRINT 0x69 #define QZ_PRINT 0x69
#define QZ_SCROLLOCK 0x6B #define QZ_SCROLLOCK 0x6B
#define QZ_PAUSE 0x71 #define QZ_PAUSE 0x71
*/
#define QZ_POWER 0x7F #define QZ_POWER 0x7F
#define QZ_BACKQUOTE 0x32 #define QZ_BACKQUOTE 0x32
#define QZ_1 0x12 #define QZ_1 0x12
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment