-
Notifications
You must be signed in to change notification settings - Fork 387
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
Clarify usage of ButtonIndex #692
Comments
If the intention is that the UA should fire selectstart/select/selectend for all buttons then their usage for primary actions should be clarified (i.e. buttonIndex=0). |
The intent is for all button presses to fire the XRInputSourceEvent. Manish, could you pick up clarifying that? |
It appears that new algorithm(s) are needed for generic button clicks, similar to those for |
@toji: Is @cwilso's assertion correct here? My longstanding understanding of |
Yeah, I came across that issue when trying to resolve this issue. My current plan was to create a concept of an action, and the UA can support as many as it wants, and one of them may be the primary action (buttonindex = 0). I don't think it's super useful to have two kinds of events. Potentially have an |
I think it’s still useful to have both kinds of events, as (IIUC) the primary action is the one that actually counts as a user action for activation and I think many simple buttons would want to just blindly hook up a click handler for select and ignore other actions. Requiring a heavier weight check here feels wrong, especially since the gamepad is an extension that not all controllers have. On top of this, if a controller doesn’t have an xr-standard mapping, is it conceivable that the “primary action” would not be index 0? |
We could not rely on the button index and straight up expose |
I think there's still the disconnect with it being a little heavyweight for things that only care about the primary and a bit of a mismatch in expectations given that the primary is also supposed to count as a user activation. |
@NellWaliczek any thoughts on what this should be here? I can make the simple changes to allow all button presses to generate select events (and enforce |
sigh @toji and I were both reading the comments in this issue and thinking "yeah... this is a bit confusing as is.. but...hmmmmm" Give us a day or so to think over what would be the right way to handle it. I'm leaning slightly towards two separate events because that makes it more sense in terms of separating developer intent, my main hesitation is that the Gamepad folks are also considering adding an event system. |
Ah, I see. Thanks! |
I'm leaning towards a separation of concerns on the events here as well, but the fact that there is (in theory) some parallel work happening on the gamepad side maybe suggests that we should defer the question of general button press events for a bit. If we removed |
Cool, I'll go ahead and do that. |
I'm inclined to either close this issue and open a new one tracking the desire to have gamepad button eventing OR rename this issue to reflect that. Any preference? |
New issue, preferably, just for cleanliness |
New issue filed. Closing this one. |
Currently the XRInputSourceEvent is only fired for select events, which should be the primary button, and per both the xr-standard mapping described in the WebXR spec and the general Gamepad spec, seems like it should always be 0 (or null if there is no Gamepad).
The buttonIndex feels like a bit of unnecessary extra data, especially if we aren't going to use XRInputSourceEvents for anything other than select (arguably what's implied by Issue #551 ).
The text was updated successfully, but these errors were encountered: