immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
382 stars 85 forks source link

Change primary button #39

Closed jfcampos closed 5 years ago

jfcampos commented 6 years ago

For Mixed Reality through SteamVR, the primary input button for the hand controller is the same button that triggers the SteamVR UI, so you can't really interact with the webxr scene.

Is there a way to change the primaryButtonIndex for an input source (or any other workaround)?

jsantell commented 6 years ago

Right now, SteamVR should be picked up as openvr IIRC: https://github.com/immersive-web/webxr-polyfill/blob/master/src/devices/WebVRDevice.js#L34-L40

Although that will work for the Vive, not sure about Microsoft MR devices (is that what you're using?)

What's the gamepad.id for the device? Is it similar to the Spatial Controller in https://github.com/stewdio/THREE.VRController/blob/master/VRController.js#L1116 ?

jfcampos commented 6 years ago

Yes i'm using MR hand controllers. The id is "Spatial Controller (Spatial Interaction Source) 045E-065B" on edge and "Spatial Controller (Spatial Interaction Source)" on Firefox using SteamVR.

jsantell commented 6 years ago

Hmm, then maybe adding spatial controller to the map here (with a value of 1) will work? https://github.com/immersive-web/webxr-polyfill/blob/master/src/devices/WebVRDevice.js#L34-L40

Could you try that? I don't have a MR device to test, but I think that would work -- can make the fix if it works for you!

jfcampos commented 5 years ago

It works! (PR #40 )

Thanks.

jsantell commented 5 years ago

Fixed via #40