immersive-web / webxr-polyfill

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

Set none to XRInputSource.handedness if gamepad.hand is empty string #96

Closed takahirox closed 4 years ago

takahirox commented 4 years ago

The polyfill updates XRInputSource.handedness from gamepad.hand.

Gamepad.hand enum is 'left', 'right', or '' while XRInputSrouce.handedness (XRHandedness) enum is 'left', 'right', or 'none'.

https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hand https://www.w3.org/TR/webxr/#xrinputsource-interface

Then I think the polyfill should sets none to XRInputSource.handedness if gamepad.hand is '' rather than always just copying gamepad.hand to XRInputSource.handedness.

toji commented 4 years ago

LGTM. Thanks!