Mac OS X: Avoid Cocoa error beep when a Cmd+key is used

This change should be reverted in some way when the OS X menus
are implemented (issue #135)
This commit is contained in:
David Capello 2014-08-28 09:50:32 -03:00
parent 44bedf070b
commit a2107f5bd9
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,7 @@
<key command="RepeatLastExport" shortcut="Ctrl+Shift+X" mac="Cmd+Shift+X" />
<key command="AdvancedMode" shortcut="F11" />
<key command="DeveloperConsole" shortcut="F12" />
<key command="Exit" shortcut="Alt+F4" />
<key command="Exit" shortcut="Alt+F4" mac="Cmd+Q" />
<key command="Cancel" shortcut="Esc">
<param name="type" value="all" />
</key>

View File

@ -198,15 +198,21 @@ void osx_event_handler()
case NSKeyDown:
if (_keyboard_installed)
osx_keyboard_handler(TRUE, event);
if ([event modifierFlags] & NSCommandKeyMask)
#if 0 // Avoid beeps TODO uncomment this when the OS X menus are ready
if ([event modifierFlags] & NSCommandKeyMask && )
[NSApp sendEvent: event];
#endif
break;
case NSKeyUp:
if (_keyboard_installed)
osx_keyboard_handler(FALSE, event);
#if 0 // Avoid beeps TODO uncomment this when the OS X menus are ready
if ([event modifierFlags] & NSCommandKeyMask)
[NSApp sendEvent: event];
#endif
break;
case NSFlagsChanged: