From bf9d66662b044917d0efe538207be8f58be5dfff Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 30 Oct 2006 16:22:59 +0000 Subject: [PATCH] add more Mac function keys --- panda/src/osxdisplay/osxGraphicsWindow.cxx | 16 ++++++++++------ panda/src/putil/keyboardButton.cxx | 9 +++++++++ panda/src/putil/keyboardButton.h | 6 ++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/panda/src/osxdisplay/osxGraphicsWindow.cxx b/panda/src/osxdisplay/osxGraphicsWindow.cxx index 2981580995..dcdd32c1a9 100644 --- a/panda/src/osxdisplay/osxGraphicsWindow.cxx +++ b/panda/src/osxdisplay/osxGraphicsWindow.cxx @@ -1155,7 +1155,7 @@ void handleWindowDMEvent (void *userData, short theMessage, void *notifyData) OSStatus osxGraphicsWindow::handleKeyInput (EventHandlerCallRef myHandler, EventRef event, Boolean keyDown) { OSStatus result = eventNotHandledErr; - if (osxdisplay_cat.is_spam()) { + if (osxdisplay_cat.is_debug()) { UInt32 keyCode; GetEventParameter (event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode); @@ -1410,11 +1410,15 @@ void osxGraphicsWindow::SystemSetWindowForground(bool forground) case 97: nk = KeyboardButton::f6(); break; case 98: nk = KeyboardButton::f7(); break; case 100: nk = KeyboardButton::f8(); break; - // case : nk = KeyboardButton::f9(); break; // seem to be used by the systems.. - // case : nk = KeyboardButton::f10(); break; - // case : nk = KeyboardButton::f11(); break; - // case : nk = KeyboardButton::f12(); break; - // case 105: nk = KeyboardButton::f13(); break; // panda does not have a 13 + case 101: nk = KeyboardButton::f9(); break; + case 109: nk = KeyboardButton::f10(); break; + case 103: nk = KeyboardButton::f11(); break; + case 111: nk = KeyboardButton::f12(); break; + + case 105: nk = KeyboardButton::f13(); break; + case 107: nk = KeyboardButton::f14(); break; + case 113: nk = KeyboardButton::f15(); break; + case 106: nk = KeyboardButton::f16(); break; // shiftable chartablet case 50: nk = KeyboardButton::ascii_key('`'); break; diff --git a/panda/src/putil/keyboardButton.cxx b/panda/src/putil/keyboardButton.cxx index bca2e22f26..899d58e486 100644 --- a/panda/src/putil/keyboardButton.cxx +++ b/panda/src/putil/keyboardButton.cxx @@ -72,6 +72,10 @@ DEFINE_KEYBD_BUTTON_HANDLE(f9) DEFINE_KEYBD_BUTTON_HANDLE(f10) DEFINE_KEYBD_BUTTON_HANDLE(f11) DEFINE_KEYBD_BUTTON_HANDLE(f12) +DEFINE_KEYBD_BUTTON_HANDLE(f13) +DEFINE_KEYBD_BUTTON_HANDLE(f14) +DEFINE_KEYBD_BUTTON_HANDLE(f15) +DEFINE_KEYBD_BUTTON_HANDLE(f16) DEFINE_KEYBD_BUTTON_HANDLE(left) DEFINE_KEYBD_BUTTON_HANDLE(right) DEFINE_KEYBD_BUTTON_HANDLE(up) @@ -134,6 +138,11 @@ init_keyboard_buttons() { ButtonRegistry::ptr()->register_button(_f11, "f11"); ButtonRegistry::ptr()->register_button(_f12, "f12"); + ButtonRegistry::ptr()->register_button(_f13, "f13"); + ButtonRegistry::ptr()->register_button(_f14, "f14"); + ButtonRegistry::ptr()->register_button(_f15, "f15"); + ButtonRegistry::ptr()->register_button(_f16, "f16"); + ButtonRegistry::ptr()->register_button(_left, "arrow_left"); ButtonRegistry::ptr()->register_button(_right, "arrow_right"); ButtonRegistry::ptr()->register_button(_up, "arrow_up"); // cannot name this 'up' since it conflicts with key-release name 'up' diff --git a/panda/src/putil/keyboardButton.h b/panda/src/putil/keyboardButton.h index bcbd6dbe13..c36ef3b41d 100644 --- a/panda/src/putil/keyboardButton.h +++ b/panda/src/putil/keyboardButton.h @@ -53,6 +53,12 @@ PUBLISHED: static ButtonHandle f11(); static ButtonHandle f12(); + // PC keyboards don't have these four buttons, but Macs do. + static ButtonHandle f13(); + static ButtonHandle f14(); + static ButtonHandle f15(); + static ButtonHandle f16(); + static ButtonHandle left(); static ButtonHandle right(); static ButtonHandle up();