From 9866d2d69f91b21b26acc7849fd3c066d504b43b Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 6 Mar 2013 22:10:04 +0000 Subject: [PATCH] Fix shift modifier (keys were sent as shift-A instead of shift-a) and add some more key input debug info --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index 00ab842f3e..e314fbe4a0 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -1571,16 +1571,24 @@ handle_key_event(NSEvent *event) { // That done, continue trying to find out the button handle. if ([str canBeConvertedToEncoding: NSASCIIStringEncoding]) { // Nhm, ascii character perhaps? + str = [str lowercaseString]; button = KeyboardButton::ascii_key([str cStringUsingEncoding: NSASCIIStringEncoding]); } } if (button == ButtonHandle::none()) { cocoadisplay_cat.warning() - << "Unhandled keypress, character " << (int) c << ", keyCode " << [event keyCode] << "\n"; + << "Unhandled keypress, character " << (int) c << ", keyCode " << [event keyCode] + << ", type " << [event type] << ", flags " << [event modifierFlags] << "\n"; return; } + if (cocoadisplay_cat.is_spam()) { + cocoadisplay_cat.spam() + << "Handled keypress, character " << (int) c << ", keyCode " << [event keyCode] + << ", type " << [event type] << ", flags " << [event modifierFlags] << "\n"; + } + // Let's get it off our chest. if ([event type] == NSKeyUp) { _input_devices[0].button_up(button);