[Bf-committers] User Preferences Option for Multitouch Gestures
p_boelens at msn.com
Sat Mar 31 18:12:02 CEST 2012
Found some time to revisit this and I think I found a work-around, though I'm not sure if it's considered clean (enough). I've opened a page on the tracker with the diff: http://projects.blender.org/tracker/index.php?func=detail&aid=30746
Basically what I did is I check the user pref status in the wm_event_system. When turned off, it then recalls wm_event_add_ghostevent() with a GHOST_kEventWheel. I'm not sure if this is allowed, but it seemed like an okay solution.
> Date: Wed, 21 Mar 2012 11:58:22 -0400
> From: significant.bit at gmail.com
> To: bf-committers at blender.org
> Subject: Re: [Bf-committers] User Preferences Option for Multitouch Gestures
> Patrick said:
> >> Ah ok, I didn't know that was considered bad practice, sorry.
> I didn't know either, until finding that diagram Kent linked to. Clean
> layer separation takes away some convenience, but lets us fit modules
> in our heads while working. Plus it makes Dijkstra smile.
> >> In my mind it made sense to tackle it at the source; "why send a trackpad event if you're not gonna use it anyway" kind of thought.
> You're right, that makes perfect sense! GHOST does lots of things
> "just in case"; it doesn't know how (or whether) events are going to
> be used. Every time I grab 20 pen events with position, pressure,
> tilt, I know that all but one will probably be converted to an
> INBETWEEN_MOUSEMOVE, and discarded because the person holding the pen
> just wants to tap a button.
> >> Then the else if where I get stuck: I can do a check to see if the event was GHOST_kTrackpadEventScroll, but then how do I treat it?
> >> Setting the event type to MOUSEZOOM won't work because of the UI amonst other things, and I can't just set it to WHEELUPMOUSE or WHEELDOWNMOUSE either, since it received a GHOST_EventTrackpad.
> >> What would the correct approach be in this case?
> Kent replied:
> > Part of the problem is ghost is a bit old and track pad stuff was tacked on later. It may need a redesign to
> > get things to work properly.
> For this trackpad gesture case, all we need is a function to set a
> (new) flag in GHOST from some higher-level code. Nothing disruptive or
> crazy, no new coupling. I would also like to have something similar
> for turning on/off MOUSEMOVE coalescing. Will a GHOST expert please
> weigh in on this?
> Mike Erwin
> musician, naturalist, pixel pusher, hacker extraordinaire
> Bf-committers mailing list
> Bf-committers at blender.org
More information about the Bf-committers