Closed ortollag closed 2 years ago
The amount that the trigger is pressed should be exposed as gamepad.buttons[0].value
. If it's not, or if that value is only returning a binary 0 or 1 then that's a bug that should be filed against the browser that you are seeing that issue in. It's defined in the spec here: https://immersive-web.github.io/webxr-gamepads-module/#xr-standard-heading
As for the menu button, it's omission is intentional. Browsers are intended to reserve one button for it's own use that can't be overridden by the user. This is important to ensure that users know there is always a consistent way to return back to the standard page and/or perform other secure actions/shortcuts/navigation/whatever with the browser. Additionally, most systems reserve at least one button for their own used (a home button, for example) so it's likely that most controllers will have up to two buttons on them that aren't accessible to the page.
While that decisions is unlikely to be reversed, it does appear to need some better documentation in the spec text. I'll look into that.
Marking as pre-CR milestone to improve the text around why these buttons are omitted
If I'm not mistaken both the menu button (three horizontal lines on Vive Controller) and the axis of the trigger (a value to return how much the trigger is pressed) aren't exposed by the API.
Is it deliberate ? If it is, I feel like both of those should be exposed in WebXR to be coherent with openXR that exposes them (for a HTC Vive) with ../input/menu/click and ../input/trigger/value.