Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHG: [touch] allow generic multi-touch swipes #2483

Closed
wants to merge 1 commit into from

Conversation

koying
Copy link
Contributor

@koying koying commented Mar 22, 2013

This allows generic multi-touch swipe detection (to match "Back" from "system/keymaps/touchscreen.xml").

Not sure it's foolproof, though...

@ghost ghost assigned Montellese Mar 22, 2013
@Montellese
Copy link
Member

This would require some extra logic that makes sure that all the swipe gestures are done in the same direction etc. But it might actually work with some small additional changes. I'll take a closer look.

@koying
Copy link
Contributor Author

koying commented Mar 26, 2013

Yeah, very crude and only works on Android because of the index/id confusion/relation exposed in #2482.
On another platform with random id's, this won't work

This one will probably be obsoleted by a gesture rework, but works for me on Android for the moment.

@Montellese
Copy link
Member

I looked at the code again and noticed two things:

  • Wouldn't it be better to count the number of touches in OnTouchDown() and OnTouchUp() instead of using "index + 1"?
  • I don't think the logic is 100% correct because OnTouchMove() will only be called for the pointer with index 0 so all the checks for the swipe direction etc will only be done for that pointer. The other pointer is completely ignored so you could touch down two fingers but only use one for swiping and the result would be the detection of a two-finger swipe. You could even do two swipes in opposite directions and it would still be recognised as a two-finger swipe in the direction of the primary pointer.

@Montellese
Copy link
Member

21cee17 works for me and also takes care of the two points I mentioned before i.e. with that code it's not possible to detect a two-finger swipe gesture if the two fingers/pointers move in different directions. Should I queue that one up as a PR and close this one?

@koying
Copy link
Contributor Author

koying commented Mar 29, 2013

Sure. Mine was really quick and dirty ;-)
Le 29 mars 2013 14:57, "Sascha Montellese" notifications@github.com a
écrit :

21cee1721cee17c493ef75be5e5a521d694cd76c3a3d05dworks for me and also takes care of the two points I mentioned before i.e.
with that code it's not possible to detect a two-finger swipe gesture if
the two fingers/pointers move in different directions. Should I queue that
one up as a PR and close this one?


Reply to this email directly or view it on GitHubhttps://github.com//pull/2483#issuecomment-15641661
.

@Montellese
Copy link
Member

Closing in favour of #2514.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants