Skip to content

Detecting if an XRInputSource is an auxiliary or a primary input source #1358

@hybridherbst

Description

@hybridherbst

The spec just states the definitions of auxiliary and primary input sources:

An XR input source is a primary input source if it supports a primary action.
An XR input source is an auxiliary input source if it does not support a primary action

but it does not provide a mechanism for applications to query if an XRInputSource does support a primary action.

Is there such a mechanism, and if not, what is the recommended approach
for applications to distinguish between auxiliary and primary input sources?

Usecase description:

  • hand tracking on Quest OS does support select events, so hands are a "primary input source" there.
  • hand tracking on Vision OS does not support select events, so hands are an "auxiliary input source" there.
  • we can emit wrapped events on Vision OS based on thumb-index distance, but then we risk sending duplicated events on Quest OS (both the wrapped event and then the system event).

Potential workaround:

  • treat all sources as auxiliary, these potentially emit wrapper events
  • once a source has received a selectstart or squeezestart event, mark it as primary and stop emitting wrapper events.
    While this would kind of work, it still has a risk of sending duplicate events the first time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions