API Reference › Input › Input.pad_button
method

Input.pad_button

Input.pad_button(pad, button) -> bool

Returns whether button on gamepad pad is held — a bit in the pad's button mask, in the SDL standard order (A/B/X/Y, bumpers, start, …).

Example

program Demo {
  entry {
    Input.set_pad(0, true, 1, 0.0, 0.0, 0.0, 0.0)
    if Input.pad_button(0, 0) { print(1) }
  }
}
← All symbols