Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-01-16 17:45:11 +0400
committerTon Roosendaal <ton@blender.org>2013-01-16 17:45:11 +0400
commitb5cffb48eadd869299e3868cecab0ba729105b7c (patch)
treec47fae4c6b5ab3263c7f4842023e2c377071449e /intern
parentcb8158cce6a35adb06c6e003a43c686aa88ebc4d (diff)
Mac OS X, Intuos tablet fix
Touch input events map nicely to trackpad input now. However, I noticed the event values are a factor 10 scaled larger compared to other touch delta's. Makes using touch input on the tablet not so nice. I found a hack to detect Wacom events, but if it works for more devices? Anyway - for me the Wacom works perfectly smooth for view manipulations now.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index f10050bfc54..77417a9e0af 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1599,7 +1599,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
}
break;
- /* these events only happen on swiping trackpads */
+ /* these events only happen on swiping trackpads or tablets */
+ /* warning: using tablet + trackpad at same time frustrates this static variable */
case NSEventTypeBeginGesture:
m_hasMultiTouchTrackpad = 1;
break;
@@ -1633,9 +1634,17 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
double dy;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ int phase = [event phase];
+
/* with 10.7 nice scrolling deltas are supported */
dx = [event scrollingDeltaX];
dy = [event scrollingDeltaY];
+
+ /* however, wacom tablet (intuos5) needs old deltas, it then has momentum and phase at zero */
+ if (phase == 0 && momentum==NULL) {
+ dx = [event deltaX];
+ dy = [event deltaY];
+ }
#else
/* trying to pretend you have nice scrolls... */