You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GestureDetector - and therefore also ActorGestureListener which is a wrapper for use in Stages - does not consider actually recevied touch events to determine multi-touch input.
Issue details
My use-case is the following: I want to offer touchpad input controls to control some entity in the game world. If the player touches outside of the touchpad he can control the game camera. Ie. panning, pinching and zooming. I use an ActorGestureListener on the underlying panel to catch camera related events. I asserted that other events consumed by the touchpad are not propagated to the ActorGestureListener.
What I noticed: Even without the GestureListener receiving events from multiple fingers (ie because other active fingers are controlling the touchpad) it fires somewhat abitrary pinch and zoom events. It turns out, that the GestureListener uses
Gdx.input.isTouched(1)
to determine if there are already two touch sources present. So it thinks it's processing multiple touch points while in realtiy it only receives events from a single one.
Reproduction steps/code
It can be reproduced by using a GestureListener that only receives touch events from a single point while there are multiple touch points present. A way to reproduce this without a real device would be to somehow mock the result of Gdx.input.isTouched(pointer).
Version of libGDX and/or relevant dependencies
1.12.1
Please select the affected platforms
Android
iOS
The text was updated successfully, but these errors were encountered:
Looks like GestureDetector should not use isTouched, it should instead track the touched state of pointers 0 and 1 itself and use that. This way a touch down the GestureDetector never sees will not cause it to consider that pointer as touched.
The code is complex enough I'm not comfortable making the changes without being able to test. A well tested PR is welcome.
The GestureDetector - and therefore also ActorGestureListener which is a wrapper for use in Stages - does not consider actually recevied touch events to determine multi-touch input.
Issue details
My use-case is the following: I want to offer touchpad input controls to control some entity in the game world. If the player touches outside of the touchpad he can control the game camera. Ie. panning, pinching and zooming. I use an ActorGestureListener on the underlying panel to catch camera related events. I asserted that other events consumed by the touchpad are not propagated to the ActorGestureListener.
What I noticed: Even without the GestureListener receiving events from multiple fingers (ie because other active fingers are controlling the touchpad) it fires somewhat abitrary pinch and zoom events. It turns out, that the GestureListener uses
to determine if there are already two touch sources present. So it thinks it's processing multiple touch points while in realtiy it only receives events from a single one.
Reproduction steps/code
It can be reproduced by using a GestureListener that only receives touch events from a single point while there are multiple touch points present. A way to reproduce this without a real device would be to somehow mock the result of
Gdx.input.isTouched(pointer)
.Version of libGDX and/or relevant dependencies
1.12.1
Please select the affected platforms
The text was updated successfully, but these errors were encountered: