touchEnded event location

Hello guys!
I am coding an app which needs to react when a touch is ended (touchEnded) and get the event’s location on the screen, but I failed to get where the event has been triggered.
Among other methods, I tried to use the native event (but any arithmetical or logical comparison systematically fails), and to compare the touches array (touches) with a touches history (prevTouches) I created. These two methods failed.
Is there a simple (or anyway easier) way to do it?

A last thing: I don’t and won’t use Ketai library, it did not work on the devices I tried, and until this point my code perfectly runs using parts of the Android API.

Hi and welcome

void setup() {
  fullScreen();
}

void draw() {
  if (touchIsStarted) {
    background(150);
  } else {
    background(255);
  }
}    

void touchStarted() {
  println("touch started");
}

void touchMoved() {
  println("touch moved"); 
}

void touchEnded() {
  println("touch ended");  
}

https://android.processing.org/reference/multitouch/events.html

I know how to handle touchEnded events. Now the problem is to get the location of the events on the screen.
Thanks anyway!

1 Like

Hi

Mouse working the same

It does not work with multitouch