Skip to content

Commit

Permalink
macos: Replace NSCommandKeyMask with NSEventModifierFlagCommand, too.
Browse files Browse the repository at this point in the history
Reference issue #106.
  • Loading branch information
icculus committed Dec 11, 2021
1 parent d7b138c commit 735f77c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SDLmain/macosx/SDLMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ - (void)setAppleMenu:(NSMenu *)menu;

/* NSEventModifierFlagOption replaced NSAlternateKeyMask in 10.12, but it's the same value. */
#define EventModifierFlagOption (1 << 19)
/* Same deal with the NSCommandKeyMask... */
#define EventModifierFlagCommand (1 << 20)

/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
Expand Down Expand Up @@ -142,7 +144,7 @@ static void setApplicationMenu(void)
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];

menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(EventModifierFlagOption|NSCommandKeyMask)];
[menuItem setKeyEquivalentModifierMask:(EventModifierFlagOption|EventModifierFlagCommand)];

[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];

Expand Down

0 comments on commit 735f77c

Please sign in to comment.