Variables

read onlydeviceConnected:FlxTypedSignal<FlxGamepad ‑> Void>

Signal for when a device is connected; returns the connected gamepad object to the attached listener

Available since

4.6.0

.

read onlydeviceDisconnected:FlxTypedSignal<FlxGamepad ‑> Void>

Signal for when a device is disconnected; returns the id of the disconnected gamepad to the attached listener

Available since

4.6.0

.

firstActive:FlxGamepad

The first accessed gamepad - can be null!

globalDeadZone:Null<Float>

Global Gamepad deadzone. The lower, the more sensitive the gamepad. Should be between 0.0 and 1.0. Null by default, overrides the deadzone of gamepads if non-null.

lastActive:FlxGamepad

The last accessed gamepad - can be null!

read onlynumActiveGamepads:Int

A counter for the number of active gamepads

Methods

@:value({ state : PRESSED })anyButton(state:FlxInputState = PRESSED):Bool

Whether any buttons have the specified input state on any gamepad.

anyInput():Bool

Whether there's any input at all on any gamepad.

inlineanyJustPressed(buttonID:FlxGamepadInputID):Bool

Whether this button was just pressed on any gamepad.

inlineanyJustReleased(buttonID:FlxGamepadInputID):Bool

Whether this button was just released on any gamepad.

anyMovedXAxis(RawAxisID:FlxGamepadAnalogStick):Float

Check to see if the X axis is moved on any Gamepad.

Parameters:

AxisID

The axis id

Returns:

Float Value from -1 to 1 or 0 if no X axes were moved

anyMovedYAxis(RawAxisID:FlxGamepadAnalogStick):Float

Check to see if the Y axis is moved on any Gamepad.

Parameters:

AxisID

The axis id

Returns:

Float Value from -1 to 1 or 0 if no Y axes were moved

inlineanyPressed(buttonID:FlxGamepadInputID):Bool

Whether this button is pressed on any gamepad.

getActiveGamepadIDs(?IDsArray:Array<Int>):Array<Int>

Get array of ids for gamepads with any pressed buttons or moved Axis, Ball and Hat.

Parameters:

IDsArray

optional array to fill with ids

Returns:

array filled with active gamepad ids

getActiveGamepads(?GamepadArray:Array<FlxGamepad>):Array<FlxGamepad>

Get array of gamepads with any pressed buttons or moved Axis, Ball and Hat.

Parameters:

GamepadArray

optional array to fill with active gamepads

Returns:

array filled with active gamepads

inlinegetByID(GamepadID:Int):FlxGamepad

Returns a FlxGamepad with the specified ID or null if none was found. For example, if there are 4 gamepads connected, they will have the IDs 0-3.

getFirstActiveGamepad():FlxGamepad

Get first found active gamepad (with any pressed buttons or moved Axis, Ball and Hat). Returns null if no active gamepad has been found.

getFirstActiveGamepadID():Int

Get first found active gamepad id (with any pressed buttons or moved Axis, Ball and Hat). Returns "-1" if no active gamepad has been found.

reset():Void

Resets all the keys on all joys.