Android controlP5 button issue

In Android is producing a strange behavior.
Need to click twice, one for highlight and other to call the action.

Also if a button is highlighted and you press in other part of the screen, the result is that the button highlighted is pressed.

is there any solution for this i saw many topics over google complaining this wrong

thanks in advance

Same here. On desktop in javaMode all works great but on the device the behaviour of the controller CP5 is not consistent.

i am trying to solve it this give some results but not accurate

void draw() {

 if (mousePressed == true) {
 setLock(controlP5.getController("slider1"), false);

  
  }
  else { 
 
   if (mousePressed == false) {
   setLock(controlP5.getController("slider2"), true);
 }
}
}

Same here, i tried lot of things, even double clicks, callbacklisteners with no luck…
In the end, what worked best for me is to check that mouse click is inside button’s position:

public void  mousePressed(){
      if (mouseX >= GUIBut_1.getPosition()[0] && mouseX <= GUIBut_1.getPosition()[0] + GUIBut_1.getWidth() && mouseY >= GUIBut_1.getPosition()[1] && mouseY <= GUIBut_1.getPosition()[1] + GUIBut_1.getHeight()){
          GUITxt_1.setText("BOTON1");
          Audio1.play();
      }
      else if (mouseX >= GUIBut_2.getPosition()[0] && mouseX <= GUIBut_2.getPosition()[0] + GUIBut_2.getWidth() && mouseY >= GUIBut_2.getPosition()[1] && mouseY <= GUIBut_2.getPosition()[1] + GUIBut_2.getHeight()){
          GUITxt_1.setText("BOTON2");
          Audio2.play();
      }
  }

@acalleja

Hi I have found solution for this issue :slightly_smiling_face::slightly_smiling_face::slightly_smiling_face:

@acalleja

Read this