Fix shift modifier (keys were sent as shift-A instead of shift-a) and add some more key input debug info

This commit is contained in:
rdb 2013-03-06 22:10:04 +00:00
parent 531c5907fc
commit 9866d2d69f

View File

@ -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);