" />

gb.buttons.held

DESCRIPTION


Function used to know when a given button is held for a given duration.

SYNTAX


gb.buttons.held(button, duration);

 

PARAMETERS


  • button (byte): the identifier of the button, to choose from BTN_A, BTN_B, BTN_C, BTN_UP, BTN_RIGHT, BTN_DOWN, BTN_LEFT
  • duration (byte): the duration in number of frames (20 frames per second by default)

RETURNS


  • boolean: returns true if the selected button is held for the given duration. Only returns true once, if you want to it to happen every X frames use gb.buttons.repeat

EXAMPLE


0