diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2009-12-02 18:02:29 +0300 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2009-12-02 18:02:29 +0300 |
commit | 863668a145477299be704de33ce282ad94bcba37 (patch) | |
tree | 29dd4ec6cd35d3334f950643f8d612332f3c1e7f /intern/ghost | |
parent | a219c93cb0415962ce09930a6475286bc4a18453 (diff) |
Cocoa: suppress unwanted beep when pressing Cmd + key on 10.4
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index b1b23963b3d..4058d721bdb 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -230,6 +230,28 @@ extern "C" { - (void)keyDown:(NSEvent *)theEvent {} +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +//Cmd+key are handled differently before 10.5 +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent +{ + NSString *chars = [theEvent charactersIgnoringModifiers]; + + if ([chars length] <1) + return NO; + + //Let cocoa handle menu shortcuts + switch ([chars characterAtIndex:0]) { + case 'q': + case 'w': + case 'h': + case 'm': + return NO; + default: + return YES; + } +} +#endif + - (BOOL)isOpaque { return YES; |