Skip to content
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

Define initial set of generic profiles #738

Merged
merged 2 commits into from Jul 2, 2019
Merged

Define initial set of generic profiles #738

merged 2 commits into from Jul 2, 2019

Conversation

toji
Copy link
Member

@toji toji commented Jun 25, 2019

This supporting PR for #695 defines an initial set of generic XRInputSource profiles that are recommended to be used as a last-resort fallback when describing a device. It's very controller-centric right now, but I don't really object to adding additional profiles like "hand" if everyone things that's useful to define right now.

@thetuvix
Copy link
Contributor

Thanks for filing this @toji!

Can you share more about your concern with a UA returning both "touchpad-thumbstick-controller" and "thumbstick-controller" at the end of their profiles list?

A few points that come to mind for discussion:

  • If a UA omits "thumbstick-controller" here for a complex controller like a Windows Mixed Reality controller or Valve Index controller, it would seem to give up potential app compat without a clear counter-balancing benefit. I expect UAs would quickly start to just add this in to support more content, and so it would become a de facto standard anyway.
  • In contrast, if the argument is that apps will all need a CDN-powered app-side mapping library anyway in the WebXR 1.0 timeframe for many other reasons, and so we should defer complex designs for now, do profiles need to be a list at all? It would then be the job of such a library and its CDN to enable apps to reason about whether an input source supports "touchpad-thumbstick-controller" or such, including any more complex remappings that may be necessary.

@thetuvix
Copy link
Contributor

Pinging @TrevorFSmith and @NellWaliczek to share their thoughts here.

@TrevorFSmith
Copy link

I support this design.

In PotassiumES the input system has two main jobs at runtime:

🌸 Map sets of low level input events into higher level actions
Example:
left-thumbstick-down | right-thumbstick-down | kb-key-23-down | wink + nod -> activate-selected-component

Developers write a JSON file that defines the input->action mapping (with recognizers and filters in the mix) and then at runtime the app framework polls the input system in the game loop.

🌸 Give users with unusual or unexpected hardware a way to map their own inputs to actions (still in development)
Example: People using custom input hardware built into their wheelchairs should be able to use standard web input events (which are already mapped onto their hardware through OS accessibility services) to set up a custom input->action map.

The web app could store this custom map using browser storage or some back-end storage and a cookie or login to recall the map. The user can also download the file for use at a later time.

Developers add a UI element to their app that brings up the custom mapping UI with a file-load/drop-target for previously created mapping files.

So, with this design PotassiumES's input system could iterate through to pick the profile with the highest specificity and route events from the XRInputSource into common input events that app developers and end users with custom hw can map to actions.

Copy link
Member

@NellWaliczek NellWaliczek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this list. One follow-up comment that can be addressed after VR complete.


The strings returned in the `profiles` array of an `XRInputSource` describe the device being used with varying levels of detail, ranging from exactly identifying the device to only giving a broad description of it's shape and capabilities. It's highly recommended that, when applicable, the last profile in the array be from a list of well-known "generic" profiles, given below.

- **"button-controller":** A controller with at least one button/trigger but no touchpad or thumbstick. Controllers with this profile must not use the `xr-standard` Gamepad mapping.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controllers with this profile must not use the xr-standard Gamepad mapping.

Now that we have named profiles, this restriction is increasingly weird to me. I get that it originally came from the need to have a primary button for triggering the select event. It just seems like we could probably cover that requirement without contorting ourselves around the need for a button in the text.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with addressing this as a separate issue post-VR complete, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I meant to revisit this after the latest changes to the xr-standard mapping. Devices with this profile should identify themselves as xr-standard now. Fixed!

@toji toji merged commit 1b6a4c2 into master Jul 2, 2019
@toji toji deleted the generic-profiles branch July 2, 2019 17:55
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

Successfully merging this pull request may close these issues.

None yet

4 participants