🔨 Used Gamepad API to setup wrapper for nicer usage.
https://piecioshka.github.io/gamepad-api/demo/
Installation:
npm install gamepad-api
Gamepad.on('SUPPORTED_EVENT', function () {
// do something ...
});
joystick:left - when user use left joystickjoystick:right - when user use right joystickarrow:uparrow:rightarrow:downarrow:leftshape:triangleshape:circleshape:crossshape:squarespecial:selectspecial:startspecial:psextra:l1extra:l2extra:r1extra:r2More details in specification: https://www.w3.org/TR/gamepad/
Thanks ben@daisyowl.com for https://html5gamepad.com/.
The MIT License @ 2026