Static methods

@:value({ index : 0 })staticget(index:Int = 0):Null<Gamepad>

staticnotifyOnConnect(?connectListener:(index:Int) ‑> Void, ?disconnectListener:(index:Int) ‑> Void):Void

Use this event to get connected gamepad index and listen to it with Gamepad.get(index).notify(axisListener, buttonListener).

Remember to also check Gamepad.get(0), gamepads may already be connected before the application was initialized.

staticremoveConnect(?connectListener:(index:Int) ‑> Void, ?disconnectListener:(index:Int) ‑> Void):Void

Variables

read onlyconnected:Bool

read onlyid:String

read onlyvendor:String

Methods

notify(?axisListener:(axisId:Int, value:Float) ‑> Void, ?buttonListener:(buttonId:Int, value:Float) ‑> Void):Void

In axisListener, axisId is axis id (for example axis == 0 is L-stick x, 1 is L-stick y, 2 is R-stick x, 3 is R-stick y, ...) and value is in -1.0 - 1.0 range.

In buttonListener, buttonId is pressed button id (layout depends on vendor), and value is in 0 - 1.0 range how hard the button is pressed.

remove(?axisListener:(axisId:Int, value:Float) ‑> Void, ?buttonListener:(buttonId:Int, value:Float) ‑> Void):Void

rumble(leftAmount:Float, rightAmount:Float):Void