[Bf-committers] Trackpad multi-touch gestures (scroll/pinch/rotate) handling patch

Damien Plisson damien.plisson at yahoo.fr
Sun Jan 3 18:59:01 CET 2010


Hi all,

During the vacation time, I was stuck in an Internet-free place (an issue), but without a mouse (more serious issue), so to keep my Blender experience as good as possible, I needed to get these shiny trackpad multitouch features operational !
So, based on trackpad pan work initiated by James Deery [his mail of Nov 5th 2009], 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 !)

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... PC users, can you confirm ? (I remember using a laptop with the 2D scroll features on its trackpad).
FYI, OSX implementation compiles from 10.4, though the 

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.

Do you think it should be kept in "auto" mode (wheel events for regular mouse, scroll/zoom/rotate events for trackpad/special mouse), or be an option user configurable ?

I've posted this as patch #20555 in the patch tracker : https://projects.blender.org/tracker/index.php?func=detail&aid=20555&group_id=9&atid=127
for your reviews, comments & suggestions.

Damien


More information about the Bf-committers mailing list