Skip to main content Link Menu Expand (external link) Document Search Copy Copied

bool pressing()

Returns true if the button is being pressed.

This function returns true for the entire duration of the press, not just when the button is first pressed, so it is recommended to not use this function for things that can only happen once per press. Instead use pressed(), clicked(), or released().

Example

brain Brain;
Button button(brain, 0, 0, 100, 50, color(255, 0, 0), color(200, 0, 0), "Click me!", 30, 20);

//... later in the code
if (button.pressing()) {
  //Do something
}