-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support game pads #19
Comments
This was referenced Sep 11, 2017
bolinfest
added a commit
to bolinfest/jsnes-web
that referenced
this issue
Feb 6, 2018
This addresses bfirsh#19 and is based off of a prototype I made over four years ago: bolinfest/jsnes@91daafe. On startup, the webapp checks to see if there are any connected Gamepads. If so, it elects to use a `GamepadController` instead of a `KeyboardController`. If the Gamepads get disconnected over the lifetime of the webapp, the current implementation waits for the Gamepads to be reconnected, though it would be more elegant if it fell back on the `KeyboardController` in this case. Note the mapping of the buttons is currently hardcoded. Ideally, there would be a GUI with a picture of the controller, highlighting one button at a time, giving the user the chance to press the corresponding button on their controller to establish the mapping. As a stopgap, we could also let users do this programmatically by stuffing values in `localStorage` because it will probably be a bit of work to create the GUI.
Fixed in #164 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.mozilla.org/en-US/docs/Web/API/Gamepad
Loads of existing implementations:
The text was updated successfully, but these errors were encountered: