The configuration options for this wrapper
Protected
axisProtected
buttonProtected
currentProtected
gamepadProtected
gamepadProtected
gamepadProtected
gamepadProtected
updateProtected
checkProtected
checkProtected
checkReturns the result of navigator.getGamepads() from the last update
An array of gamepad objects, or an empty array if the gamepad api is not supported
If true, navigator.getGamepads() will be called inmediately before returning, if gamepad changes happened since the last update, this will cause those change events to fire.
offGamepadAxisChange: remove an existing event listener for when a gamepad axis changes
The calback function to remove (must be the same function passed to onGamepadAxisChange())
offGamepadButtonChange: remove an existing event listener for when a gamepad button changes
The calback function to remove (must be the same function passed to onGamepadButtonChange())
remove an existing event listener for when a gamepad (either real or emulated) is connected
The calback function to remove (must be the same function passed to onGamepadConnect())
remove an existing event listener for when a gamepad (either real or emulated) is disconnected
The calback function to remove (must be the same function passed to onGamepadDisconnect())
add an event listener for each time a gamepad axis changes. The callback function will be called with the gamepad index, the gamepad object, and a boolean array of the changed axes, The callback is called separately for each gamepad where axes have changed.
The calback function to call when a gamepad axis state changes
onGamepadButtonChange add an event listener for each time a gamepad button changes. The callback function will be called with the gamepad index, the gamepad object, and a array of the changed buttons containing details about how the button transitioned or false if the button state didn't change this frame. Callback is called separately for each gamepad where buttons have changed.
The calback function to call when a gamepad button state changes
add an event listener for when a gamepad (either real or emulated) is connected
The calback function to call when a gamepad is connected
add an event listener for when a gamepad (either real or emulated) is disconnected
The calback function to call when a gamepad is disconnected
Changes the button configs used by the wrapper (will only take effect after the next gamepad update)
Protected
tickGenerated using TypeDoc
Wrapper for the Gamepad API that smooths out browser inconsistancies. Exposes changes to gamepads, buttons and axes as events.