mousePressed with Android - Processing

3

I'm making a mobile application with Processing 3.0.1 (latest version) for Android (the tablet I'm using is the Galaxy Tab 3 with Android 4.4.2 to run the code)

When I run the code in Java Mode it goes perfectly. But when I put the Android Mode everything works fine except the function mousePressed() which is as if it were late, I have to do tab twice to perform something that in Java Mode does with just one click.

I'm using this example code on the Processing website to make sure it has nothing to do with other things that I have implemented.

Does anyone know what may be happening? I do not find any reference to this. Thanks!

    
asked by AConti 25.01.2016 в 20:32
source

1 answer

3

This is a well-known detail in Android, I recommend you validate the execution

boolean ejecutaUnaVez;

void mousePressed() {
 if (mousePressed && ejecutaUnaVez== false) {
     ejecutaUnaVez= true;
 }
 if (mouseReleased) {
   ejecutaUnaVez= false;
 }
}
    
answered by 28.01.2016 / 01:06
source