gamepad-api
v1.0.5
Published
🔨 Used Gamepad API to setup wrapper for nicer usage.
Downloads
237
Maintainers
Readme
gamepad-api
🔨 Used Gamepad API
to setup wrapper for nicer usage.
Preview 🎉
https://piecioshka.github.io/gamepad-api/demo/
Install
npm install gamepad-api
API
Gamepad.on('SUPPORTED_EVENT', function () {
// do something ...
});
Supported events
Joysticks
joystick:left
- when user use left joystickjoystick:right
- when user use right joystick
Arrows
arrow:up
arrow:right
arrow:down
arrow:left
Shapes
shape:triangle
shape:circle
shape:cross
shape:square
Special
special:select
special:start
special:ps
Extras
extra:l1
extra:l2
extra:r1
extra:r2
Gamepad API
More details in specification: https://www.w3.org/TR/gamepad/
Thanks
Thanks [email protected] for https://html5gamepad.com/.