From 213408d4c99cc3c2fa8ae52962fcc8097b7a0c39 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 May 2013 21:19:30 +0000 Subject: Fix #35340: 3D manipulator not working right after undoing with cmd+Z on OS X. 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 76bc68d5bfe..0be26e594f1 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -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]; } -- cgit v1.2.3