Fix #35340: 3D manipulator not working right after undoing with cmd+Z on OS X.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 13 May 2013 21:19:30 +0000 (21:19 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 13 May 2013 21:19:30 +0000 (21:19 +0000)
Another issue with the recent Ghost changes here. For some reason key up events
are not coming through when the command key is pressed. I can't figure out why,
for now just always handle them, still fixes the original bug.

intern/ghost/intern/GHOST_SystemCocoa.mm

index 76bc68d5bfeb814e02603f4a0b070be70f10a155..0be26e594f19145dcf89ad16e455c72ff98b1d59 100644 (file)
@@ -939,12 +939,18 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
                        // get keyDown events delivered to the view because they are
                        // special hotkeys to switch between views, so override directly
 
-                       if([event type] == NSKeyDown &&
+                       if ([event type] == NSKeyDown &&
                           [event keyCode] == kVK_Tab &&
                           ([event modifierFlags] & NSControlKeyMask)) {
                                handleKeyEvent(event);
                        }
                        else {
+                               // For some reason NSApp is swallowing the key up events when command
+                               // key is pressed, even if there seems to be no apparent reason to do
+                               // so, as a workaround we always handle these up events.
+                               if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask))
+                                       handleKeyEvent(event);
+
                                [NSApp sendEvent:event];
                        }