Support system-wide keyboard shortcuts on Mac gsoc2009_IME
authorJiang Jiang <gzjjgod@gmail.com>
Mon, 25 May 2009 11:09:29 +0000
branchgsoc2009_IME
changeset 3128 05d83835f41b
parent 3127 da6cbfa5b5f2
child 3129 e42873b9c6f1
Support system-wide keyboard shortcuts on Mac
src/video/cocoa/SDL_cocoaevents.m
--- a/src/video/cocoa/SDL_cocoaevents.m	Mon May 25 02:42:45 2009 +0000
+++ b/src/video/cocoa/SDL_cocoaevents.m	Mon May 25 11:09:29 2009 +0000
@@ -193,6 +193,10 @@
             Cocoa_HandleKeyEvent(_this, event);
             /* Fall through to pass event to NSApp; er, nevermind... */
             /* FIXME: Find a way to stop the beeping, using delegate */
+
+            /* Add to support system-wide keyboard shortcuts like CMD+Space */
+            if ([event modifierFlags] & NSCommandKeyMask)
+               [NSApp sendEvent: event];
             break;
         default:
             [NSApp sendEvent:event];