Page MenuHome

Trackpad multi-touch gestures (scroll/pinch/rotate) handling
Closed, ArchivedPublicPATCH

Description

I've implemented the handling of the trackpad 2-fingers gestures :

- 2 fingers scroll (MOUSEPAN / GHOST_kTrackpadEventScroll event) pans the view
- 2 fingers pinch (MOUSEZOOM / GHOST_kTrackpadEventMagnify event) zooms the view
And in 3D view:
- alt + 2 fingers scroll rotates the view
- 2 fingers rotation (MOUSEROTATE / GHOST_kTrackpadEventRotate) rotates the view around the axis orthogonal to the screen (the 3rd axis !)

The implementation uses a new GHOST event type: GHOST_kEventTrackpad, that is then dispatch as Blender MOUSEPAN, MOUSEZOOM or MOUSEROTATE events.

This is currently fully implemented for OSX (GHOST Cocoa fires the new events), but there must be some PC laptops with similar features that'll take advantage of this... Linux/Win users, can you confirm ? (I remember using a laptop with the 2D scroll features on its trackpad).

In Ghost, I've currently implemented an auto-detection of the source peripheral, so that a regular mouse still sends MOUSEWHEEL events.
Apple special mice behave like trackpad (not configurable from documented API), so the mighty mouse trackball sends 2D scroll events. And the magic mouse touch gestures must be like trackpad's.

Event Timeline

This is a general problem with patch, but just so you'll know...

tried using patch for windows with this file, in a cmd I ran:
C:\blender>"C:\Program Files\GnuWin32\bin\Patch" -p0 < trackpad_m
ultitouch.patch
patching file intern/ghost/GHOST_Types.h
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


I've updated the acceleration parameters:
- zoom speed divided by 4
- panning using quadratic acceleration

small variant in trackpad_multitouch_orbit.patch :
- rotate gestures makes orbiting rotation (like alt+pan on x axis)

Committed in svn rev 25897

Damien Plisson (damien78) changed the task status from Unknown Status to Unknown Status.Jan 11 2010, 12:20 PM