Gamepad class Input
Manages input from connected gamepads.
This class handles the detection of gamepads, reading their states (buttons, axes, triggers), and providing an interface to query these states. It supports multiple gamepads up to MAX_PORTS.
Constructors
- Gamepad()
-
Creates a new
Gamepad
manager.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
angle(
int port, Joystick joystick) → double - Calculates the angle of a specified joystick on a given gamepad port.
-
countDevices(
) → int - Returns the number of currently connected and mapped gamepads.
-
joyDown(
int port, GamepadButton btn) → bool - Checks if a specific button on a given gamepad port is currently held down.
-
joyHit(
int port, GamepadButton btn) → bool - Checks if a specific button on a given gamepad port was just pressed in the current frame.
-
joyUp(
int port, GamepadButton btn) → bool - Checks if a specific button on a given gamepad port was just released in the current frame.
-
joyX(
int port, Joystick joystick) → double - Gets the current X-axis value of a specified joystick on a given gamepad port.
-
joyY(
int port, Joystick joystick) → double - Gets the current Y-axis value of a specified joystick on a given gamepad port.
-
joyZ(
int port, Trigger trigger) → double - Gets the current value of a specified analog trigger on a given gamepad port.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited