class flixel.input.gamepad.FlxGamepad implements IFlxDestroyable

Available on all platforms

Class Fields

static var JUST_PRESSED:Int

static var JUST_RELEASED:Int

static var PRESSED:Int

static var RELEASED:Int

Instance Fields

var deadZone:Float

Gamepad deadzone. Sets the sensibility. * Less this number the more gamepad is sensible. Should be between 0.0 and 1.0.

var id:Int

function new(ID:Int, ?GlobalDeadZone:Float = 0):Void

function anyButton():Bool

Check to see if any buttons are pressed right now.

function anyInput():Bool

Check to see if any buttons are pressed right or Axis, Ball and Hat Moved now.

function anyJustPressed(ButtonIDArray:Array<Int>):Bool

Check if at least one button from an array of button IDs was just pressed. * *

ButtonArray

An array of button IDs *

returns

Whether at least one of the buttons was just pressed

function anyJustReleased(ButtonIDArray:Array<Int>):Bool

Check if at least one button from an array of button IDs was just released. * *

ButtonArray

An array of button IDs *

returns

Whether at least one of the buttons was just released

function anyPressed(ButtonIDArray:Array<Int>):Bool

Check if at least one button from an array of button IDs is pressed. * *

ButtonIDArray

An array of button IDs *

returns

Whether at least one of the buttons is pressed

function checkStatus(ButtonID:Int, Status:Int):Bool

Check the status of a button * *

ButtonID

Index into _keyList array. *

Status

The key state to check for *

returns

Whether the provided button has the specified status

function destroy():Void

function firstJustPressedButtonID():Int

Get the first found ID of the button which has been just pressed. * Returns -1 if no button was just pressed.

function firstJustReleasedButtonID():Int

Get the first found ID of the button which has been just released. * Returns -1 if no button was just released.

function firstPressedButtonID():Int

Get the first found ID of the button which is currently pressed. * Returns -1 if no button is pressed.

function getAxis(AxisID:Int):Float

Gets the value of the specified axis - DOES NOT WORK WELL ON * THE FLASH TARGET, use getXAxis() and getYAxis() instead.

function getButton(ButtonID:Int):FlxGamepadButton

function getXAxis(AxisID:Int):Float

Gets the value of the specified X axis.

function getYAxis(AxisID:Int):Float

Gets the value of the specified Y axis - * should be used in flash to correct the inverted y axis.

function justPressed(ButtonID:Int):Bool

Check to see if this button was just pressed. * *

ButtonID

The button ID. *

returns

Whether the button was just pressed

function justReleased(ButtonID:Int):Bool

Check to see if this button was just released. * *

ButtonID

The button ID. *

returns

Whether the button was just released.

function pressed(ButtonID:Int):Bool

Check to see if this button is pressed. * *

ButtonID

The button ID. *

returns

Whether the button is pressed

function reset():Void

function update():Void

Updates the key states (for tracking just pressed, just released, etc).