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.
read-only
buttonB bool
Returns true if the B button is pressed down.
read-only
buttonBack bool
Returns true if the back button is pressed down.
read-only
buttonStart bool
Returns true if the start button is pressed down.
read-only
buttonX bool
Returns true if the X button is pressed down.
read-only
buttonY bool
Returns true if the Y button is pressed down.
read-only
dpadDirection Direction
Returns the eight-way direction pressed on the d-pad, or center if the dpad is not pressed.
read-only
dpadDown bool
Returns true if the D-pad direction is down.
read-only
dpadLeft bool
Returns true if the D-pad direction is left.
read-only
dpadRight bool
Returns true if the D-pad direction is right.
read-only
dpadUp bool
Returns true if the D-pad direction is up.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
isConnected bool
Returns true if the gamepad is currently connected.
final
leftShoulder bool
Returns true if the left shoulder button is pressed down.
read-only
leftThumb bool
Returns true if the left thumbstick is clicked.
read-only
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.
read-only
rightThumb bool
Returns true if the right thumbstick is clicked.
read-only
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.
read-onlyinherited

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