mac-specific hack to disable standard command-Q and command-H shortcuts

This commit is contained in:
Wolfgang Thaller 2018-01-10 23:17:18 +01:00
parent 16326934bf
commit 8f683c9613

View File

@ -29,5 +29,18 @@ void macosx_hide_menu_bar(int mouseY)
| NSApplicationPresentationAutoHideDock];
dock = true;
}
if(!inited)
{
// Zap keyboard equivalents in the application menu.
// Emulated mac apps are used to owning Command-H,
// and they really need to handle Command-Q.
NSMenuItem *menutitle = [[NSApp mainMenu] itemAtIndex: 0];
NSMenu *menu = [menutitle submenu];
for(NSMenuItem *item in [menu itemArray])
{
item.keyEquivalent = @"";
}
}
inited = true;
}