Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Made the xr-standard gamepad mapping more rigid #735
Made the xr-standard gamepad mapping more rigid #735
Changes from 5 commits
fe541f6
7491a14
1670adc
910c8af
5fe32aa
1e23e2a
2866ab1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Side question, since primary axes were already required before: Are we requiring that all
xr-standard
gamepads have either a touchpad or thumbstick? What about simpler "remote-style" controllers?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.
My thoughts when initially laying out the mapping were that we wanted to ensure that if something was advertised as
xr-standard
developers could depend on it having a certain baseline level of functionality. I still think that's a reasonable goal, though it's maybe less important if paired with the profiles concept. And yes, that would mean that some input devices (Like the Daydream controller) wouldn't qualify forxr-standard
.If we wanted to loosen up on that restriction and simply say that
xr-standard
only means that the inputs are mapped to a predictable place, and does not imply which of them are present then we could do so. I think we might want to look at expanding the proposed generic profile set to be a bit more descriptive in that case, with variants like:button-controller
touchpad-controller
// This is basically just the daydream controller and.... anything else?touchpad-button-controller
thumbstick-controller
// Never seen a thumbstick controller without a separate triggerthumbstick-button-controller
touchpad-thumbstick-controller
// Is this actually a thing anywhere?touchpad-thumbstick-button-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 aligns with what I've been thinking here. Before, we only had one concept,
xr-standard
, overloaded to serve two purposes:xr-standard
defined which controller parts map to whichbuttons
/axes
IDsxr-standard
promised a minimum profile of controller parts that developers could assume were presentWe've now split these into two distinct
mapping
andprofile
concepts in the API. It seems reasonable to embrace that, simplifying the meaning of thexr-standard
mapping to a pure ID mapping, and allowing profiles to make more specific promises.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.
Should we continue this thread as part of #738?
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 support this direction. I'd kinda been feeling the same way as I looked over the actual spec text changes.
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.
In order to introduce further reserved indices in the future, we'd need some way to reconcile the additional indices. (I suppose this is true before this change as well)
Perhaps apps need to be explicit that they want an
xr-standard
mapping for theirGamepad
- that way, we can later introduce anxr-standard-2
mapping or such that pushes out into button/axis 5, 6, etc.Should the
gamepad
attribute perhaps begetGamepad(mapping)
?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 pretty strongly against making that large of a change to this chunk of the API this late. (Though I don't object to introducing a
xr-standard-2
at some point if needed.)I do think we'll likely outgrow the current shape of the gamepad API at some point, but when that time comes I have a hunch that we'll be better served by introducing something along the lines of an action mapping API rather than continue to hack more robust concepts onto an API that obviously never expected to deal with them. (And hopefully at that point we have a few years of insight into how developers are using OpenXR to help inform our direction.)
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.
Sounds good.
Even if we later do need to support what I said in the gamepad API, there are slightly less clean ways to do it later without changes now - for example, when requesting your
XRSession
, you could centrally setxr-standard-2
as your preferring mapping for receivingxr-standard*
gamepad buttons/axes.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.
It seems fine to require at least a primary button/trigger for
buttons[0]
.Should we more strongly state then that this button MUST also trigger
onselect
for thisXRInputSource
?