GamepadState class

The current status of a gamepad.

Constructors

GamepadState(bool isConnected, int _buttonBitmask, int leftTrigger, int rightTrigger, int leftThumbstickX, int leftThumbstickY, int rightThumbstickX, int rightThumbstickY)
const
GamepadState.disconnected()
Represents a disconnected gamepad.
factory

Properties

buttonA bool
Returns true if the A button is pressed down.
no setter
buttonB bool
Returns true if the B button is pressed down.
no setter
buttonBack bool
Returns true if the back button is pressed down.
no setter
buttonStart bool
Returns true if the start button is pressed down.
no setter
buttonX bool
Returns true if the X button is pressed down.
no setter
buttonY bool
Returns true if the Y button is pressed down.
no setter
dpadDirection Direction
Returns the eight-way direction pressed on the d-pad, or center if the dpad is not pressed.
no setter
dpadDown bool
Returns true if the D-pad direction is down.
no setter
dpadLeft bool
Returns true if the D-pad direction is left.
no setter
dpadRight bool
Returns true if the D-pad direction is right.
no setter
dpadUp bool
Returns true if the D-pad direction is up.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Returns true if the gamepad is currently connected.
final
leftShoulder bool
Returns true if the left shoulder button is pressed down.
no setter
leftThumb bool
Returns true if the left thumbstick is clicked.
no setter
leftThumbstickX int
Left thumbstick x-axis value.
final
leftThumbstickY int
Left thumbstick y-axis value.
final
leftTrigger int
The current value of the left trigger analog control. The value is between 0 and 255.
final
rightShoulder bool
Returns true if the right shoulder button is pressed down.
no setter
rightThumb bool
Returns true if the right thumbstick is clicked.
no setter
rightThumbstickX int
Right thumbstick x-axis value.
final
rightThumbstickY int
Right thumbstick y-axis value.
final
rightTrigger int
The current value of the right trigger analog control. The value is between 0 and 255.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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