Revision: 53205
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53205
Author:   ton
Date:     2012-12-20 12:01:15 +0000 (Thu, 20 Dec 2012)
Log Message:
-----------
Bug fix #28915 and #33538

Mac OS X trackpad and 'mighty mouse' fix.

An old commit from Damien in 2010 tried to make mighty mouse touches work as if
this is a scrollwheel. The error in that code was that the "kinetic scrolling"
feature failed. When releasing your fingers, the events passed on to Blender
then switched from "trackpad pan" to "mousewheel zoom".

This commit makes trackpads and mighty mouse behave identical. Only difference
is that trackpad panning needs 2 fingers, mighty mouse only one.

Note that trackpad and mighty mouse 3d zoom works with holding ctrl!

All works nice with this kinetic feature now. Fun :)

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

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h       2012-12-20 
11:46:58 UTC (rev 53204)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h       2012-12-20 
12:01:15 UTC (rev 53205)
@@ -296,8 +296,6 @@
        /** Multitouch trackpad availability */
        bool m_hasMultiTouchTrackpad;
        
-       /** Multitouch gesture in progress, useful to distinguish trackpad from 
mouse scroll events */
-       bool m_isGestureInProgress;
 };
 
 #endif // __GHOST_SYSTEMCOCOA_H__

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2012-12-20 
11:46:58 UTC (rev 53204)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2012-12-20 
12:01:15 UTC (rev 53205)
@@ -551,7 +551,6 @@
        char *rstring = NULL;
        
        m_modifierMask =0;
-       m_isGestureInProgress = false;
        m_cursorDelta_x=0;
        m_cursorDelta_y=0;
        m_outsideLoopEventProcessed = false;
@@ -1580,8 +1579,7 @@
                        
                case NSScrollWheel:
                        {
-                               /* Send trackpad event if inside a trackpad 
gesture, send wheel event otherwise */
-                               if (!m_hasMultiTouchTrackpad || 
!m_isGestureInProgress) {
+                               if (!m_hasMultiTouchTrackpad) {
                                        GHOST_TInt32 delta;
                                        
                                        double deltaF = [event deltaY];
@@ -1641,12 +1639,6 @@
                                pushEvent(new GHOST_EventTrackpad([event 
timestamp] * 1000, window, GHOST_kTrackpadEventRotate, x, y,
                                                                  -[event 
rotation] * 5.0, 0));
                        }
-               case NSEventTypeBeginGesture:
-                       m_isGestureInProgress = true;
-                       break;
-               case NSEventTypeEndGesture:
-                       m_isGestureInProgress = false;
-                       break;
                default:
                        return GHOST_kFailure;
                        break;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to