The Gamepad module exposes a type that lets you classify gamepads.
This decoder directly takes a JSON value and decodes it into a list of gamepads.
Whether the gamepad is currently connected.
This library aims to offer you all the functions you need. If it somehow doesn't, however, you may use the following functions to find what you need.
Gets all available buttons on the controller as one list of buttons.
Gets all available joysticks on the controller as one list of joysticks.
Get a given button at a specific location in the array of buttons.
If the button doesn't exist, the function returns a fake button that is never pressed.
Get a given joystick at a specific location in the array of joysticks.
If the joystick doesn't exist, the function returns a fake joystick that is never pressed.
The Gamepad type represents a player's game controller. Every gamepad type is a separate device that is handled by a different player.