joyDown method

bool joyDown(
  1. int port,
  2. GamepadButton btn
)

Checks if a specific button on a given gamepad port is currently held down.

Returns true if the button is pressed, false otherwise or if the port is invalid.

Implementation

bool joyDown(int port, GamepadButton btn) {
  if (port < 0 || port >= _input.length) return false;
  return _input[port].buttonDown[btn.index];
}