Creates the instance and assigns event handlers to gamepad events
Object containing all connected controllers
Object containing the callback for when a controller is connected
Controllers connected before an event listener caught them.
Controllers connected before an event listener caught them.
Object containing the callback for when a controller is disconnected
The version of the module.
The logger module this module uses to log errors / logs.
Static
getGets the angle between two points
The starting point
The ending point
The angle between the starting point and the ending point
This gets the first controller connected. This controller is dominant
The first controller connected
An array of all connected controllers
Attaches a callback to the specified event.
The event to attach the callback to
The function to be called when the event is triggered
The GamepadManagerSingleton instance
A gamepadmanager to help with games / handling input from a controller GamepadManagerSingleton
License
GamepadManager does not have a license at this time. For licensing contact the author
Author
https://github.com/doubleactii
Todo
Currently bluetooth gamepads when disconnecting (PS4 only) do no fire a disconnected event. Manually calling
this.gamepad.vibrationActuator.reset()
can force it to call a disconnect event, but this is a messy way of checking each tick to see if the gamepad is still connected. It also will cancel ongoing vibrations. Find a fix. (This is a GamepadAPI issue/OS issue/not code wise issue)