Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foohyfooh/gamepad-events
A simple library for gamepad API in the browser. Since there aren't any events for button presses or axis movement, this fires events to simulate that.
https://github.com/foohyfooh/gamepad-events
Last synced: 27 days ago
JSON representation
A simple library for gamepad API in the browser. Since there aren't any events for button presses or axis movement, this fires events to simulate that.
- Host: GitHub
- URL: https://github.com/foohyfooh/gamepad-events
- Owner: foohyfooh
- Created: 2016-07-17T21:13:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-18T14:20:01.000Z (over 2 years ago)
- Last Synced: 2024-10-14T20:43:34.261Z (2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Gamepad Events
A simple library for gamepad API in the browser. Since there aren't any events
for button presses or axis movement, this fires events to simulate that.For more information on the API check https://w3c.github.io/gamepad/
## Events
Event Name | Description
--- | ---
gamepad_button_pressed | When a button is pressed
gamepad_button_released | When a button is released
gamepad_axis_moved | When an axis is moved### gamepad_button_pressed and gamepad_button_released
Property | Description
--- | ---
gamepad | The index of the gamepad that fired the event
button | The button pressed or released
pressed | If the button is pressed or released
value | The value indicating the magnitude to which the button is pressed or released### gamepad_axis_moved
Property | Description
--- | ---
gamepad | The index of the gamepad that fired the event
axis | The axis moved
value | The value indicating the magnitude to which the axis movedCheck [index.html](index.html) for an example of how to use the library.