WebXR-emulator-extension
WebXR-emulator-extension copied to clipboard
Wrong gamepad button configuration for Oculus Touch.
Bug report from @checksummaster in https://github.com/MozillaReality/WebXR-emulator-extension/issues/31#issuecomment-619264598
About button, with oculus touch, I should change some code like that (not so sure why then I don't make a pull request for this) const BUTTON = { SELECT: 1, SQUEEZE: 2 }; before it was 0,1 but 0 is the thump (on the joystick)
this is from aframe
/**
- Button indices:
- 0 - thumbstick (which has separate axismove / thumbstickmoved events)
- 1 - trigger (with analog value, which goes up to 1)
- 2 - grip (with analog value, which goes up to 1)
- 3 - X (left) or A (right)
- 4 - Y (left) or B (right)
- 5 - surface (touch only) */ var INPUT_MAPPING_WEBVR = { left: { axes: {thumbstick: [0, 1]}, buttons: ['thumbstick', 'trigger', 'grip', 'xbutton', 'ybutton', 'surface'] }, right: { axes: {thumbstick: [0, 1]}, buttons: ['thumbstick', 'trigger', 'grip', 'abutton', 'bbutton', 'surface'] } };
Here is different mapping https://immersive-web.github.io/webxr-gamepads-module/#xr-standard-gamepad-mapping index 0 -> Primary trigger, 1 -> Primary squeeze button, 2 -> Primary touchpad, 3 -> Primary thumbstick
And for axes [0, 1] -> Primary touchpad X, Y [2, 3] -> Primary thumbstick X, Y
I also checked it right now on my Oculus Go in an example for controller state and when I press the trigger the first button is pressed:
But when I pres select button in WebXR extension in Chrome the third button is selected.
I'm also praying for support of all buttons and axes from the extension.
Thanks for the report and investigation. I'd like to try to resolve in the next release v0.4.0. Also PR is welcome!
It fixed in this fork. https://github.com/illusioneering/WebXR-emulator-extension (this fork don't have the last modification and not work with aframe 1.2) This fork also supports more buttons for the quest.
I'm not the one that makes this fork but maybe a pull request should be appropriate.