Attempt to fix mouse-look in game engine on OS X: setCursorPosition. Thanks Malachy...
authorErwin Coumans <blender@erwincoumans.com>
Sun, 24 Dec 2006 21:21:49 +0000 (21:21 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Sun, 24 Dec 2006 21:21:49 +0000 (21:21 +0000)
intern/ghost/intern/GHOST_SystemCarbon.cpp

index 9e790154eb9bf6ffd99ff15d1dc2b265219396ea..e1e3853e8a86efa51107ecb7dc63c19c6f456f3c 100644 (file)
@@ -493,7 +493,13 @@ GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt3
 {
        float xf=(float)x, yf=(float)y;
 
+       CGAssociateMouseAndMouseCursorPosition(false);
+       CGSetLocalEventsSuppressionInterval(0);
        CGWarpMouseCursorPosition(CGPointMake(xf, yf));
+       CGAssociateMouseAndMouseCursorPosition(true);
+
+//this doesn't work properly, see game engine mouse-look scripts
+//     CGWarpMouseCursorPosition(CGPointMake(xf, yf));
        // this call below sends event, but empties other events (like shift)
        // CGPostMouseEvent(CGPointMake(xf, yf), TRUE, 1, FALSE, 0);