npm.io
1.0.6 • Published 1 year ago

gamepad-api

Licence
MIT
Version
1.0.6
Deps
1
Size
26 kB
Vulns
0
Weekly
0
Stars
7

gamepad-api

node version npm version downloads count size license

Used Gamepad API to setup wrapper for nicer usage.

Preview

https://piecioshka.github.io/gamepad-api/demo/

Usage

Installation:

npm install gamepad-api
Gamepad.on('SUPPORTED_EVENT', function () {
  // do something ...
});

API / Supported events

  • Joysticks

    • joystick:left - when user use left joystick
    • joystick: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 ben@daisyowl.com for https://html5gamepad.com/.

License

The MIT License

Keywords