gamepad.js library for gamepad and joystick support in browser
It smoothes over the differences between browsers, platforms, APIs, and the wide variety of gamepad/joystick devices.
It offers two major features:
- A consistent mapping everywhere, so that you can simply access attributes like .leftStickX or .dpadDown rather than having to try to configure the device in your game/program.
- Images of the buttons/triggers/devices that correspond to the actual device the user has in their hand, so that you can offer intelligent prompts and help text. So, rather than “Press Button 0”, you can show a picture of the correct button. For example: