mirror of
https://github.com/digarok/gsplus.git
synced 2024-07-03 13:29:32 +00:00
27 lines
507 B
Objective-C
27 lines
507 B
Objective-C
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
void fix_mac_menu(void) {
|
|
|
|
/*
|
|
* add an option-key modifier to all menu shortcuts
|
|
* eg, command-Q -> option+command-Q
|
|
*/
|
|
|
|
@autoreleasepool {
|
|
if (NSApp) {
|
|
NSMenu *menu = [NSApp mainMenu];
|
|
|
|
for (NSMenuItem *a in [menu itemArray]) {
|
|
for (NSMenuItem *b in [[a submenu] itemArray]) {
|
|
unsigned m = [b keyEquivalentModifierMask];
|
|
if (m & NSEventModifierFlagCommand)
|
|
[b setKeyEquivalentModifierMask: m | NSEventModifierFlagOption];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|