From 422dcba69b088ee0c81daf345ec3aa1ace6d0b09 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 24 Nov 2016 18:47:51 -0300 Subject: [PATCH] Fix Cmd+[ shortcut to go back in the file selector on macOS --- src/app/ui/file_selector.cpp | 4 ++-- src/she/osx/event_queue.mm | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/ui/file_selector.cpp b/src/app/ui/file_selector.cpp index bb8f2c3e1..f379f7a54 100644 --- a/src/app/ui/file_selector.cpp +++ b/src/app/ui/file_selector.cpp @@ -198,8 +198,8 @@ protected: int unicode = keyMsg->unicodeChar(); bool up = (msg->cmdPressed() && scancode == kKeyUp); bool enter = (msg->cmdPressed() && scancode == kKeyDown); - bool back = (msg->cmdPressed() && msg->shiftPressed() && unicode == '['); - bool forward = (msg->cmdPressed() && msg->shiftPressed() && unicode == ']'); + bool back = (msg->cmdPressed() && (unicode == '[' || scancode == kKeyOpenbrace)); + bool forward = (msg->cmdPressed() && (unicode == ']' || scancode == kKeyClosebrace)); #else bool up = (msg->altPressed() && scancode == kKeyUp); bool enter = (msg->altPressed() && scancode == kKeyDown); diff --git a/src/she/osx/event_queue.mm b/src/she/osx/event_queue.mm index c80ea18da..5759a76d4 100644 --- a/src/she/osx/event_queue.mm +++ b/src/she/osx/event_queue.mm @@ -32,12 +32,11 @@ retry:; inMode:NSDefaultRunLoopMode dequeue:YES]; if (event) { - // Intercept Control+Tab and send it to the main NSView. Without - // this, the NSApplication intercepts the key combination and - // use it to go to the next key view. - if (event.type == NSKeyDown && - event.modifierFlags & NSControlKeyMask && - event.keyCode == kVK_Tab) { + // Intercept , , and other keyboard + // combinations, and send them directly to the main + // NSView. Without this, the NSApplication intercepts the key + // combination and use it to go to the next key view. + if (event.type == NSKeyDown) { [app.mainWindow.contentView keyDown:event]; } else {