-
Notifications
You must be signed in to change notification settings - Fork 48
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
Potential registry format #76
Conversation
{ | ||
"genericProfiles" : [ | ||
"button-controller", | ||
"thumbstick-controller", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in issue #70 , these names are ambiguous about the presence of a grip button. Here is what I have implemented in Chrome, which avoids the ambiguity:
controller
touchpad-controller
thumbstick-controller
touchpad-thumbstick-controller
grip-controller
grip-touchpad-controller
grip-thumbstick-controller
grip-touchpad-thumbstick-controller
This covers all the possible xr-standard Gamepads by specifying whether or not each optional element (grip, touchpad, thumbstick) are present. The trigger button will always be present, so it's not required in the name. JS code could even parse these generic strings to figure out the basic functionality of the controller without even needing to query a registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm supportive of making the presence of a grip button part of the generic profiles. Initially I was worried about a combinatorial explosion of profile strings, but if we limit it to just the xr-standard
inputs and list them in the same order each time (as Jacob shows) then it seems very manageable and useful to developers. I have no opinon on the ordering of elements other than to say I'd be fine with the above list as-is. (With the addition of button-controller
as we originally had.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is button-controller
supposed to mean a controller with just a trigger button (but no grip button)?
And yes, I agree we should limit the generic profiles to covering functionality from xr-standard inputs. If developers want to know about additional optional buttons (such as Oculus touch A/B buttons), then they need to look at the more specific profile strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, button-controller
would be a device with only a trigger button (or only a primary button, even if it wasn't trigger-shaped.) It would basically be the fallback for an xr-standard
device where none of the other generic profiles applied. The only device I'm aware of that it would apply to off the top of my head is the HoloLens clicker, but regardless of how common it is it's a decen idea to have a clear plan for how to address any devices that fit that description.
"customProfiles" : { | ||
"google-daydream" : [ "touchpad-controller" ], | ||
"htc-vive" : [ "touchpad-controller" ], | ||
"microsoft-045e-065d" : [ "thumbstick-touchpad-controller" ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens to be the "Samsung Odyssey", which could be exposed with a human readable name of "samsung-odyssey".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the WebVR timeframe, these were the strings that Microsoft chose to expose. @thetuvix needs to weigh in on what Microsoft actually wants here.
In the realm of "huh, that's an eerie coincidence", I'd actually started to ponder this exact problem earlier today. It's also somewhat related to this issue I filed in the gamepad repo a while back immersive-web/webxr-gamepads-module#3. In any event, after talking it over with @toji a bit, I'd like to propose the following generic profile names.
Our reasoning behind the names was based on several factors.
Lastly, given that this list of generic profiles ended up fairly tightly tied to the xr-standard mapping, I'd like to suggest we move the definition of these particular generic profiles into the webxr-gamepads-module. To reiterate something we've said before though, the profile ids are not unique to gamepad-based input sources. Which means we'll need to make it very clear in the module text that the gamepad-related generic profiles list does not exhaustively cover all potential XRInputSources, but that it only exhaustively covers profileIds allowed by an XRInputSource with a non-null gamepad. |
@kearwood is this something Mozilla has an opinion on? |
ping ... |
Closing in favor of #78 |
A really early stab at how we might define the registry. This will probably end up moving into a different folder, but for now...
I put three sections in the json. The first, is the list of agreed up on generic profiles. The third is the legacy controller names for WebVR.
The interesting part is the second section. "customProfiles" is a terrible name, but in the interest of not getting stuck in the weeds bikeshedding.... the important bit here is that I've got an entry for each hardware device. That entry's value is an array of the strings. The XRInputSource.profiles[0] will be the custom profile key and all the subsequent XRInputSource.profiles elements will be the values of the custom profiles array in order.
A few questions that come to mind...
Lots to think about.