Binding boolean actions to analogue inputs

Looking at the suggested binding functions, is there a way to bind a boolean action to a specific direction on a vector2f input? For example, binding a “Teleport” action to “Up on the left thumbstick” is a common VR control scheme.

Unity’s XR input sample has two Teleport actions, one for boolean and one for axis, which seems like an unfortunate pattern as it would clutter up the runtime’s binding UI with double actions for everything?

I think the way this would be done is with “Binding Modifiers”. There’s a general framework for them now, and a prototype version of an extension from Valve for such analog threshold control. I’m not sure the current status, though, since I believe we discovered an error in that prototype extension that prompted the more general extension: basically the Valve extension right now requires you to put multiple copies of the same struct type on a chain for some use cases, but that’s not allowed by OpenXR (only the first of each type in a chain is considered). I do not know what the plan is, I’ll see if I can get some info or maybe prompt an update to the extension :slight_smile:

I see, so you’d bind Teleport to “/user/hand/left/input/thumbstick/y” with a Binding Modifier that says the analog value has to be above 0.5 for example (or below -0.5 if you want an action on “down”).

When reading the spec, I assumed there would be paths to handle the “thumbstick/trackpad as dpad” case, like:

/user/hand/left/input/thumbstick/up
/user/hand/left/input/thumbstick/down
/user/hand/left/input/thumbstick/left
/user/hand/left/input/thumbstick/right

With the activate/release thresholds handled automatically by the runtime, so each application doesn’t have to tune reasonable thresholds for every type of hardware.