-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
The events for some gamepad buttons do not work. #3317
Comments
@hanekoo Good question! Out of curiosity what gamepad hardware are you using? I want to make sure we add these buttons to excalibur I think this is a limitation of the current Excalibur implementation, it can't read past 16 without some modification. You might be able to patch the Otherwise I think you might have to reach into the native js gamepad until we fix this in Excalibur. MDN has some good docs here https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API
|
Thank you for your reply. I am using a Nintendo Pro controller, and the Home (index 16) and Screenshot (index 17) buttons are missing. A generic gamepad should include 17 buttons. Here are some documents you can refer to: I believe the GamepadButtonEvent should provide the button indices from the Gamepad API instead of filtering them out. This would allow for more extensibility and flexibility(To support more types of gamepads). |
@hanekoo Awesome, thanks for the info. I totally agree! I'll see what we can do to make this more extensible, in theory should be low effort to fix. Give me a few days :) |
@hanekoo This should be fixed in the latest alpha https://www.npmjs.com/package/excalibur/v/0.31.0-alpha.1327 Thanks again! |
Happy New Year! Generally, the 17 common buttons are enough, but it would be even better if the index could be exposed: class GamepadButtonEvent extends GameEvent<Gamepad> {
button: Buttons;
index: number; // Not just when the button is unknown
value: number;
self: Gamepad;
...
} For example, the Xbox Elite series controllers have additional PADDLE buttons. |
Good job! And [email protected] tested fine. |
In Chrome, the gamepad is recognized with 18 buttons, but the GamepadButtonEvent.Buttons only provides 16 buttons, and the additional two buttons do not trigger events. How can I get events for all the buttons?
The text was updated successfully, but these errors were encountered: