https://github.com/alvaromontoro/gamepad-simulator
A JS simulator for the Gamepad API
https://github.com/alvaromontoro/gamepad-simulator
gamepad gamepad-api gamepad-simulator hacktoberfest
Last synced: 9 months ago
JSON representation
A JS simulator for the Gamepad API
- Host: GitHub
- URL: https://github.com/alvaromontoro/gamepad-simulator
- Owner: alvaromontoro
- License: mit
- Created: 2020-07-24T02:26:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T09:06:07.000Z (over 3 years ago)
- Last Synced: 2025-04-02T15:38:33.703Z (over 1 year ago)
- Topics: gamepad, gamepad-api, gamepad-simulator, hacktoberfest
- Language: JavaScript
- Homepage:
- Size: 196 KB
- Stars: 34
- Watchers: 1
- Forks: 6
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# gamepad-simulator
A JS simulator for testing the Gamepad API.
This module creates a virtual gamepad on the screen that triggers the same events that a real gamepad gamepad would.
## How to use
1. Import the file to your project
2. Create the virtual gamepad on the screen with `gamepadSimulator.create()`
3. Simulate the gamepad connection with `gamepadSimulator.connect()`
4. Click ont he icons and axes and read the values using the standard `navigator.getGamepads()`
5. Simulate the gamepad disconnection with `gamepadSimulator.disconnect()`
6. Remove the virtual gamepad from the screen with `gamepadSimulator.destroy()`