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 :)
This commit is contained in:
parent
4e2bc939c1
commit
8914433cd0
@ -296,8 +296,6 @@ protected:
|
||||
/** 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__
|
||||
|
@ -551,7 +551,6 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
|
||||
char *rstring = NULL;
|
||||
|
||||
m_modifierMask =0;
|
||||
m_isGestureInProgress = false;
|
||||
m_cursorDelta_x=0;
|
||||
m_cursorDelta_y=0;
|
||||
m_outsideLoopEventProcessed = false;
|
||||
@ -1580,8 +1579,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
|
||||
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 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user