Gamepad class

Represents a gamepad controller.


Gamepad(int controller)
Creates an instance of Gamepad for the specified controller.


appHasFocus bool
Controls whether the gamepad is active.
no getter
controller int
The identifier for the current controller.
gamepadBatteryInfo GamepadBatteryInfo
Get the battery type for the gamepad.
no setter
hashCode int
The hash code for this object.
no setterinherited
headsetBatteryInfo GamepadBatteryInfo
Get the battery type for a headset attached to the gamepad, if there is one.
no setter
isConnected bool
Returns a value for whether the controller is connected.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state GamepadState
The status of the buttons, triggers and thumbsticks on the gamepad.
getter/setter pair


noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.
updateState() → void
Get the current state of the current controller.
vibrate({int leftMotorSpeed = 0, int rightMotorSpeed = 0}) → void
Activate a gamepad controller's vibration motors.


operator ==(Object other) bool
The equality operator.