🔨 Used Gamepad API
to setup wrapper for nicer usage.
https://piecioshka.github.io/gamepad-api/demo/
npm install gamepad-api
Gamepad.on('SUPPORTED_EVENT', function () {
// do something ...
});
joystick:left
- when user use left joystickjoystick:right
- when user use right joystickarrow:up
arrow:right
arrow:down
arrow:left
shape:triangle
shape:circle
shape:cross
shape:square
special:select
special:start
special:ps
extra:l1
extra:l2
extra:r1
extra:r2
More details in specification: https://www.w3.org/TR/gamepad/
Thanks ben@daisyowl.com for https://html5gamepad.com/.