immersive-web / webxr-polyfill

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

Squeeze event support #121

Closed takahirox closed 4 years ago

takahirox commented 4 years ago

This PR adds squeeze/squeezestart/squeezeend events defined in WebXR API Editor's draft

One thing. I'm not sure how to find primary squeeze button index in WebVRDevice. Similarly to primary button index, can we detect from gamepad.id? I set it the default value -1 (no squeeze button) in WebVRDevice so far.

https://github.com/immersive-web/webxr-polyfill/blob/95a437a3ceaf30ed452f7cf0ac0e14ebb5f084f8/src/devices/WebVRDevice.js#L307

toji commented 4 years ago

LGTM. The squeeze buttons are likely going to have to be defined on a per-device basis for the polyfill, but this puts all the right pieces in place for us to wire that up. Thanks!