-
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
Multitouch panning not working correctly #767
Comments
I made some further tests to find the best way to calculate better deltaXY values... I'm not quite sure how those values are calculated right now, but I found that the easiest and most reliable way is by taking the average of all touchmovements in
deltaY would work the same way obviously... |
On v2.0.3 I'm seeing Maybe this is the same issue you saw, @demrks? |
@sfrdmn Yes... I expected the same. It should always be: This and some other problems (see above) made it pretty much impossible for me to create a very simple gallery (pan, zoom in etc.) with hammer.js. Single touch works just fine, but as soon as the touch/pointer count changes (one finger pan -> pinch etc.) both the deltaXY values and the events (e.g. Unfortunately I didn't see any progress with hammer.js, so I'm not sure if this will ever get fixed. In the end I had to write a gesture detection library myself. I took most of the API and event object names though from hammer.js and can only hope that someone takes over this library. |
@demrks development did stall for a while but i have taken over leading the project and we are putting together a team and development is starting again. |
I am trying to simulate a scrollable area so I can lazily render a large area. In your examples, two-fingered swipe on my mac (yosemite) using chrome is not detected. Is that related to this issue or is it just how the examples are configured? Is there an example out there that detects two-finger (horizontal) swipe, as that is default gesture for scroll on mac? |
A lot of this was likely cleaned up by the fixes to pan event ordering and touch ordering, we should revisit both the issues mentioned here for |
I just tried to implement a horizontal swipe handler that does different things based on the number of fingers used. I'm using https://github.com/RyanMullins/angular-hammer and testing on an LG G2, and it looks like Not sure where the issue is, and I'm not too keen to debug this further, but just FYI. |
In reply to @dancek and to save someone else the 30 minutes I just wasted on this: |
@daniel-wer If I set up two pan handlers (pointers=1 and pointers=2) and one pinch, the first pan handler is ignored, even when I try to |
@daniel-wer For anyone that runs into the same problem: If you REALLY want two different, simultaneous, pan handlers you must rename the N.B: I'm using TypeScript. So something like this: const pan1 = new Hammer.Pan({event: "pan1", direction: Hammer.DIRECTION_ALL, pointers: 1, threshold: 0});
const pan2 = new Hammer.Pan({event: "pan2", direction: Hammer.DIRECTION_ALL, pointers: 2, threshold: 0});
hammerManager.add(pan1);
hammerManager.add(pan2);
hammerManager.on("pan1", (e) => ...
hammerManager.on("pan2", (e) => ... But in the end I just used one pan handler with const pan = new Hammer.Pan({event: "pan2", direction: Hammer.DIRECTION_ALL, pointers: 0, threshold: 0}); |
@bes confirmed.
|
I was trying to implement multitouch panning with hammer.js, so that you can start panning with one finger and continue with another one.
I thought that the deltaXY values already took care of that, but apparently the values of both deltaX and deltaY are sometimes jumping from one value to another. So if you do:
*Left finger down, Left finger pan (working), Right finger down (Left finger is still down), Right finger pan, Right finger up, Right finger down, Right finger pan etc. *
things get really weird. Similar things happen if the number of touch points change (e.g. pinch and pan at the same time), but this is probably related to #596.
I even tried to set
mc.set({ pointers: 1 });
(no multitouch panning), but the second touch/pointer sometimes still fires 'panmove/panstart' events. In either case the deltaX/deltaY values are jumping randomly.'panstart' in general is not really reliable currently. Sometimes it gets fired for a second touch, sometimes it doesn't.
The text was updated successfully, but these errors were encountered: