[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56728] trunk/blender/intern/ghost/intern/ GHOST_SystemCocoa.mm: Fix ctrl+(shift) +tab shortcut key not working on OS X after recent bugfix to

Brecht Van Lommel brechtvanlommel at pandora.be
Mon May 13 00:15:06 CEST 2013


Revision: 56728
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56728
Author:   blendix
Date:     2013-05-12 22:15:05 +0000 (Sun, 12 May 2013)
Log Message:
-----------
Fix ctrl+(shift)+tab shortcut key not working on OS X after recent bugfix to
interact better with system shortcuts.

This is a special shortcut for switching between views and does not get
delivered directly to our view when we pass it through the application key
event handling path. We only have a single OpenGL view, so there's no need to
pass it on to the application, instead just interpret it directly.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2013-05-12 22:00:09 UTC (rev 56727)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2013-05-12 22:15:05 UTC (rev 56728)
@@ -934,7 +934,20 @@
 			// Send event to NSApp to ensure Mac wide events are handled,
 			// this will send events to CocoaWindow which will call back
 			// to handleKeyEvent, handleMouseEvent and handleTabletEvent
-			[NSApp sendEvent:event];
+
+			// There is on special exception for ctrl+(shift)+tab. We do not
+			// get keyDown events delivered to the view because they are
+			// special hotkeys to switch between views, so override directly
+
+			if([event type] == NSKeyDown &&
+			   [event keyCode] == kVK_Tab &&
+			   ([event modifierFlags] & NSControlKeyMask)) {
+				handleKeyEvent(event);
+			}
+			else {
+				[NSApp sendEvent:event];
+			}
+
 			[pool drain];
 		} while (event != nil);
 #if 0




More information about the Bf-blender-cvs mailing list