-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add -1 to the set of allowed indices #158
base: gh-pages
Are you sure you want to change the base?
Conversation
Gamepad API has been rewritten to use algorithms in the time since the WebXR issue was filed. Now there are algorithmic steps for selecting a gamepad index and constructing a Gamepad, but these steps assume we're connecting a "traditional gamepad" (as WebXR describes it) and should not be used to initialize XR gamepads. WebXR should define new steps for constructing a Gamepad from an XR input source. Since the requirements in the "index attribute" description are already defined in the algorithm for initializing the attribute, let's remove the duplicate information so the description is correct regardless of how the attribute is initialized. Maybe just the first sentence is okay?
Actually, this is incorrect since a Gamepad object retains its index after it's disconnected and no longer exposed by getGamepads(). Let's keep it simple and let the algorithms define what the behavior is. If we need to add more information, put it in a non-normative block.
|
@nondebug Thanks! How about now? |
7b7d424
to
45f40cc
Compare
r? @nondebug |
@nondebug hi, this issue remains as a sole blocker for WebXR gamepads API to CR. any update on this? |
@nondebug ping? |
We discussed this during the editor's meeting. We would prefer not to add this to our spec and it should just be part of WebXR. |
"It should just be a part of WebXR" isn't quite clear: currently WebXR sets it to -1 which is not actually allowed by this spec. Should we say that we are modifying the Gamepads spec? Or should we do something else here? The use case of "gamepads that are not in |
Ok, we will take another look at the editor's meeting and see if we can suggest figure out a path forward. |
We discussed this and decided to refactor the "A new gamepad" algorithm to take an index parameter, which can be undefined (in which case we will use the "selecting an unused gamepad index" algorithm). Then WebXR Gamepads module can create the Gamepad with index initialized to -1. |
Thank you! |
Closes immersive-web/webxr-gamepads-module#27
The WebXR module constructs Gamepads that are not exposed via
navigator.getGamepads()
, this adds a-1
value forindex
that can accomodate them.Preview | Diff