diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-07-30 11:06:58 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-07-30 11:26:49 +0200 |
commit | c3d15b50b498620b87951d6e89035bc4271ac38f (patch) | |
tree | e67ebca187a3d5f3fa19b6c8cc1e93088bffa57e /osdep/macosx_application.m | |
parent | 471dfba0188939db0cee587ca329fdb7b4d1812c (diff) | |
download | mpv-c3d15b50b498620b87951d6e89035bc4271ac38f.tar.bz2 mpv-c3d15b50b498620b87951d6e89035bc4271ac38f.tar.xz |
cocoa: fix key equivalent dispatching
Prior to this commit we had a list of key modifiers and checked against that.
Actually, the Cocoa framework has a built in way to do it and it involves
calling performKeyEquivalent: on the menu instance.
Fixes #946
cc @mpv-player/stable: this should apply with no conflicts
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r-- | osdep/macosx_application.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 6c7748080c..047dfeab65 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -86,7 +86,12 @@ Application *mpv_shared_app(void) [NSEvent addLocalMonitorForEventsMatchingMask:NSKeyDownMask|NSKeyUpMask handler:^(NSEvent *event) { - return [self.eventsResponder handleKey:event]; + BOOL equivalent = [[NSApp mainMenu] performKeyEquivalent:event]; + if (equivalent) { + return (NSEvent *)nil; + } else { + return [self.eventsResponder handleKey:event]; + } }]; NSAppleEventManager *em = [NSAppleEventManager sharedAppleEventManager]; |