Skip to content

[Gamepad API] Feedback for GamepadEventDrivenInputAPI explainer #1039

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

Open
nondebug opened this issue May 19, 2025 · 2 comments
Open

[Gamepad API] Feedback for GamepadEventDrivenInputAPI explainer #1039

nondebug opened this issue May 19, 2025 · 2 comments

Comments

@nondebug
Copy link

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/GamepadEventDrivenInputAPI/explainer.md

@nondebug
Copy link
Author

Gamepad API currently supports three types of inputs: buttons, axes, and touch surfaces. The current proposal would fire events when buttons or axes change but not touch inputs. If this is intentional then consider calling out touch surface inputs as explicitly out of scope in the non-goals section. If touch surfaces are out of scope then I think the event should be renamed so it's clear it only fires for button and axis changes.

Alternatively, the proposal could be extended to fire rawgamepadinputchange when any input changes, including touch inputs. For touch surfaces I think it would make sense to add three arrays to the event to list the touchIds for updated touch points. A "changed" array lists all touchId values for updated touch points, a "down" array lists touchId values for new touch points, and an "up" array lists touchId values for touch points that ended.

// Touch ID 0 ends, touch ID 1 moves, touch ID 2 starts.
touchesChanged: [0, 1, 2],
// Touch ID 2 starts.
touchesDown: [2],
// Touch ID 0 ends.
touchesUp: [0]

GamepadButton has a touched member which indicates when the button is detecting touch. It's possible for the touched member to change while the pressed and value members remain unchanged. If that happens, should rawgamepadinputchange be fired? I think it makes the most sense to fire the event for any change to any Gamepad attribute, including touch.

@snehagarwal1
Copy link
Contributor

Thank you for the feedback Matt, surely we can consider adding touch inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants