gb.buttons.repeat

From Gamebuino Wiki
Jump to: navigation, search

Description

Function used to trigger a repetitive action at a given period when a button is held down.

Syntax

gb.buttons.repeat(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 every <duration> frames when the button is held down

Example

See also