Joystick class

A joystick device.

SDL Docs

Constructors

Joystick(Sdl sdl, Pointer<SDL_Joystick> handle)
Create an opened joystick.

Properties

attached bool
Returns true if this joystick has been opened.
no setter
controller GameController?
Get a controller associated with this joystick.
no setter
handle Pointer<SDL_Joystick>
The pointer for this object.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hasLed bool
Check if this joystick has an LED.
no setter
hasRumble bool
Whether this joystick supports rumble.
no setter
hasRumbleTriggers bool
Check if this joystick has rumble triggers.
no setter
instanceId int
Get the ID of this joystick.
no setter
isHaptic bool
Query if a joystick has haptic features.
no setter
name String
Get the name of this joystick.
no setter
numAxes int
Get the number of axes supported by this joystick.
no setter
numBalls int
Get the number of balls for this joystick.
no setter
numButtons int
Get the number of buttons for this joystick.
no setter
numHats int
Get the number of hats for this joystick.
no setter
powerLevel JoystickPowerLevel
Get the power level for this joystick.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sdl Sdl
The SDL bindings to use.
finalinherited
type JoystickType
Get the type of this joystick.
no setter

Methods

close() → void
Close this joystick.
destroy() → void
How this object should be destroyed.
inherited
getAxis(int axis) int
Get the current state of an axis control.
getBall(int ball) Point<int>
Get the ball axis change since the last poll.
getButton(int button) bool
Get the current state of a button.
getHat(int hat) JoyHatValue
Get the position of a hat.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openHaptic() Haptic
Open a haptic device for use from a joystick device.
rumble({required int duration, int lowFrequency = 65535, int highFrequency = 65535}) bool
Start a rumble effect.
rumbleTriggers({required int duration, int lowFrequency = 65535, int highFrequency = 65535}) bool
Start a rumble trigger effect.
toString() String
A string representation of this object.
inherited

Operators

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