Fix Cmd+[ shortcut to go back in the file selector on macOS

This commit is contained in:
David Capello 2016-11-24 18:47:51 -03:00
parent 33d6ffb73b
commit 422dcba69b
2 changed files with 7 additions and 8 deletions

View File

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

View File

@ -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 <Control+Tab>, <Cmd+[>, 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 {