{"repo":"Tom32i/gamepad.js","free":true,"listed":false,"github":"https://github.com/Tom32i/gamepad.js","clone":"git clone https://github.com/Tom32i/gamepad.js.git","description":"A simple HTML5 Gamepad handler that provides keyboard-like events for Gamepad sticks and buttons.","language":"JavaScript","stars":37,"topics":["game-development","controllers","xbox-controller","xbox","gamepad","events","javascript"],"license":"MIT","category":"game-templates","readme_excerpt":"gamepad.js ================ A simple HTML5 Gamepad handler that provides keyboard-like events for Gamepad axes and button. Try it right now in your browser: http://tom32i.github.io/gamepad.js/ Installation: npm install gamepad.js Import HTML: HTML module: ES modules: CommonJs modules: Usage: Configuration: Property Type Default Description -------- ---- ------- ----------- analog boolean true Set to false to get fixed value: e.g for a axis [-1, 0, 1]. Used to reduce the number of change event triggered if you dont need analog values. precision integer 0 When in analog mode, set the number of decimals. Used to reduce the muber of event triggered but keep analog values. deadZone float 0 Percent of noise to ignore around 0. Ex: deadZone set to 0.3 will cause axis position of from -0.3 to 0.3 to be considered 0. Axes moves below 30% from default positon won't trigger a change. Theses options can be set for the whole gamepad: Or distinctly for axes and buttons: Events: To listen for events use the listener.addEventListener(eventName, callback); method (also available under alias listener.on(...) ). To stop listening for events use the listener.removeEventListener(eventName, callback); method (also available under alias listener.off(...) ). gamepad:connected A new gamepad is connected. gamepad:disconnected A gamepad was disconnected. gamepad:axis A gamepad axis value has changed. Optional: Can be listened for a specific Gamepad index: gamepad:{gamepad}:axis . Optional: Can be liste","default_branch":null,"files":null,"tree":[],"storefront":"/r/Tom32i","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Tom32i/gamepad.js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}