Skip to content

Commit

Permalink
Fix longPress being triggered on back Android System gesture (#7265)
Browse files Browse the repository at this point in the history
  • Loading branch information
obigu committed Oct 31, 2023
1 parent 7fb3965 commit b3989cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gdx/src/com/badlogic/gdx/input/GestureDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ public boolean touchUp (float x, float y, int pointer, int button) {
return handled;
}

@Override
public boolean touchCancelled (int screenX, int screenY, int pointer, int button) {
cancel();
return super.touchCancelled(screenX, screenY, pointer, button);
}

/** No further gesture events will be triggered for the current touch, if any. */
public void cancel () {
longPressTask.cancel();
Expand Down

0 comments on commit b3989cb

Please sign in to comment.