v3.0.0: added proper support for touches cancelled by system gestures

This commit is contained in:
Evan Debenham
2025-01-22 16:49:55 -05:00
parent 38d2731fde
commit 0a602a9fb1
5 changed files with 30 additions and 31 deletions
@@ -133,11 +133,13 @@ public class InputHandler extends InputAdapter {
@Override
public boolean touchCancelled(int screenX, int screenY, int pointer, int button) {
//currently emulating functionality from libGDX 1.11.0, do we keep this?
//in particular this is probably a more graceful way to handle things like system swipes on iOS
//whereas previously they generated garbage inputs sometimes
//which were then fixed in v2.2.2
return touchUp(screenX, screenY, pointer, button);
if (button >= 3 && KeyBindings.isKeyBound( button + 1000 )) {
KeyEvent.addKeyEvent( new KeyEvent( button + 1000, false ) );
} else if (button < 3) {
PointerEvent.addPointerEvent(new PointerEvent(screenX, screenY, pointer, PointerEvent.Type.CANCEL, button));
}
return true;
}
@Override