diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 08:40:49 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 08:43:04 +0300 |
commit | d1548176e227df3840c644a8a9d384b14fc842f8 (patch) | |
tree | 6c103b2280b5783253e4099f7215783972d8a641 /src | |
parent | e0b41301a8cfaed746ea823c133e69b15d273c0b (diff) |
macOS: Fixed missing menu shortcuts
The built-in alternate bindings shouldn't affect the menu shortcuts.
Diffstat (limited to 'src')
-rw-r--r-- | src/macos.m | 4 | ||||
-rw-r--r-- | src/ui/keys.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/macos.m b/src/macos.m index 0dcc3ef5..61507b6f 100644 --- a/src/macos.m +++ b/src/macos.m | |||
@@ -497,7 +497,7 @@ void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem * | |||
497 | [myDel setCommand:[NSString stringWithUTF8String:items[i].command] forMenuItem:item]; | 497 | [myDel setCommand:[NSString stringWithUTF8String:items[i].command] forMenuItem:item]; |
498 | /* Bindings may have a different key. */ | 498 | /* Bindings may have a different key. */ |
499 | const iBinding *bind = findCommand_Keys(items[i].command); | 499 | const iBinding *bind = findCommand_Keys(items[i].command); |
500 | if (bind) { | 500 | if (bind && bind->id < builtIn_BindingId) { |
501 | key = bind->key; | 501 | key = bind->key; |
502 | kmods = bind->mods; | 502 | kmods = bind->mods; |
503 | } | 503 | } |
@@ -533,7 +533,7 @@ void handleCommand_MacOS(const char *cmd) { | |||
533 | if (command) { | 533 | if (command) { |
534 | const iBinding *bind = findCommand_Keys( | 534 | const iBinding *bind = findCommand_Keys( |
535 | [command cStringUsingEncoding:NSUTF8StringEncoding]); | 535 | [command cStringUsingEncoding:NSUTF8StringEncoding]); |
536 | if (bind) { | 536 | if (bind && bind->id < builtIn_BindingId) { |
537 | setShortcut_NSMenuItem_(menuItem, bind->key, bind->mods); | 537 | setShortcut_NSMenuItem_(menuItem, bind->key, bind->mods); |
538 | } | 538 | } |
539 | } | 539 | } |
diff --git a/src/ui/keys.h b/src/ui/keys.h index 90e33b7c..4cbca3b7 100644 --- a/src/ui/keys.h +++ b/src/ui/keys.h | |||
@@ -56,6 +56,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
56 | # define subscribeToPage_KeyModifier SDLK_d, KMOD_SHIFT | KMOD_PRIMARY | 56 | # define subscribeToPage_KeyModifier SDLK_d, KMOD_SHIFT | KMOD_PRIMARY |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #define builtIn_BindingId 1000 /* not user-configurable */ | ||
60 | |||
59 | iDeclareType(Binding) | 61 | iDeclareType(Binding) |
60 | 62 | ||
61 | struct Impl_Binding { | 63 | struct Impl_Binding { |