-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Recognizing the start and stop of a gesture (Hammer 2.0) #574
Comments
You can now listen to pinchstart/pinchend/pinchcancel and the same for the rotate recognizer. A list of all events that are being triggered for the default recognizers;
|
It got me thinking; why not emit a pan/pinch/rotate-move event, and always trigger a pan/pinch/rotate, regardless it's state. so now;
|
Cool, works for me! |
@jtangelder I'm working on a project where I want to separately track one-finger pans and two-finger pans. So I'm setting up two separate Pan recognizers on my Hammer manager, each with a custom event name option. This gives me separate events for the one-finger and two-finger gestures, but I then lose all the more granular pan events (pan panstart panmove panup pandown panleft panright panend pancancel). I think it'd be really great if you could listen for those standard Pan events and maybe they get prefixed with the special name you gave that recognizer. Or perhaps instead, there could be some property of the event object that tells you which of the original Pan events it corresponds to. |
hi @bradleybossard ,I know this is irrelevant,I'm struggling in debug multi-touch,can you share how you log this infomation? onRotate 0 0 2 268 hame2.js:124 |
So, in the previous version of Hammer, you could listen for the transformstart and transformend events, but I don't see anything similar to that in Hammer 2.0. Looking at the events that I listen to, I see there are two properties, isFirst and isFinal, which sound like I could do something similar with. But, when I print the values out, then don't seem to change. For instance, running some code similar to below, I get the following output, where I don't see isFirst or isFinal change value.
Anyway, what I am trying to do (and maybe going about it the wrong way) is detect when a gesture starts, particularly the rotate one, b/c I'm writing an app where I can words that can be rotated, so if a word have been rotated, then the rotation stops and starts again, I need to incorporate the previous rotation into the new gesture (the new gesture always seems to start from angle 0, correct). Is there a prescribed way of doing this, or is it just that the isFirst and isFinal values aren't being propagated yet?
Thanks for your help in advance.
onRotate 0 0 2 268 hame2.js:124
onRotate 0 0 2 303 hame2.js:124
onRotate 0 0 2 327 hame2.js:124
onRotate 0 0 2 351 hame2.js:124
onRotate 0 0 2 368 hame2.js:124
onRotate 0 0 2 393 hame2.js:124
onPan 0 0 2 160 hame2.js:118
onPan 0 0 2 170 hame2.js:118
onPan 0 0 2 190 hame2.js:118
onPan 0 0 2 214 hame2.js:118
onPan 0 0 2 247 hame2.js:118
onPan 0 0 2 277 hame2.js:118
The text was updated successfully, but these errors were encountered: