Page MenuHomePhabricator

efl/gesture: more accurately handle flick/momentum recognition with multi-touch

Authored by zmike on Jan 23 2020, 12:25 PM.



if we have one of these gestures where we are flicking/momentuming with multiple
touch points, we want to permit this so long as the touch points are moving vaguely
in the same direction, e.g., press -> swipe with 2 fingers

with this, we now cancel these gestures with multi-touch active if we detect motion
with subsequent touch events that doesn't match the vector of the "active" press
for which we are monitoring events

Depends on D11164

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
zmike created this revision.Jan 23 2020, 12:25 PM
zmike requested review of this revision.Jan 23 2020, 12:25 PM
CHAN requested changes to this revision.Jan 28 2020, 4:19 AM

Please check comment thank you.


Even if we cancel the flick gesture because the direction of the two fingers is different,
should we continue the gesture tracking until user release the fingers?


The momentum gesture concept triggers when there is momentum even when the moving is not like line.
This code seems to cancel when the direction of the gesture is different. Is it intended?

This revision now requires changes to proceed.Jan 28 2020, 4:19 AM
zmike added inline comments.Jan 28 2020, 6:22 AM

I'm not sure. I can't really think of a scenario where we'd expect this to work? Maybe if someone does a zoom then a flick? But wouldn't they release their fingers after the zoom?


Oh, is it? According to the docs, this is a swipe, which I thought was supposed to be vaguely linear?

zmike updated this revision to Diff 28670.Jan 29 2020, 11:21 AM
zmike edited the summary of this revision. (Show Details)


CHAN added a comment.Jan 29 2020, 10:52 PM

Even if the flick gesture is aborted, it recognizes again when move is detected.

I think the continue value should be true in this case. Am I misunderstanding the case?


Yes i think so. the gesture layer doc said that

The momentum gesture is used for detecting any move events on the gesture layer and getting event information to make a meaningful gesture action. The momentum gesture is used for detecting line, zoom, and rotate gestures as well.

But its kinda legacy. if you have better idea lets discuss.

zmike added inline comments.Jan 30 2020, 7:27 AM

In the current code here, the gesture recognizers are all totally independent and there is no dependency. Perhaps I misunderstood your meaning here.

The intent here is to keep momentum (swipe) as being an actual swipe and not just moving a finger around randomly, which can be tracked by a custom recognizer or just monitoring multi move events.

CHAN accepted this revision.Feb 4 2020, 11:51 PM

Looks good to me.

This revision is now accepted and ready to land.Feb 4 2020, 11:51 PM
Closed by commit rEFL5abe7f14d2ff: efl/gesture: more accurately handle flick/momentum recognition with multi-touch (authored by zmike, committed by Marcel Hollerbach <>). · Explain WhyFeb 5 2020, 1:14 AM
This revision was automatically updated to reflect the committed changes.