From e41651cb28d0e4c216254efae58b2ca9e716f54e Mon Sep 17 00:00:00 2001 From: Andy Gill Date: Tue, 5 May 2020 12:48:15 -0500 Subject: [PATCH] Update Oculus Go controller documentation for WebXR (#4574) * Document the legacy WebVR events for oculus go controller * WebVR uses trackpad, not just WebVR on Oculus Go --- docs/components/oculus-go-controls.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/components/oculus-go-controls.md b/docs/components/oculus-go-controls.md index 7e2bea3e8d8..329a13cde20 100644 --- a/docs/components/oculus-go-controls.md +++ b/docs/components/oculus-go-controls.md @@ -42,16 +42,27 @@ and/or pressed buttons (trackpad, trigger). | Event Name | Description | | ---------- | ----------- | -| trackpadchanged | Trackpad changed. | -| trackpaddown | Trackpad pressed. | -| trackpadup | Trackpad released. | -| trackpadtouchstart | Trackpad touched. | -| trackpadtouchend | Trackpad not touched. | -| trackpadmoved | Trackpad moved. | +| touchpadchanged | Touchpad changed. | +| touchpaddown | Touchpad pressed. | +| touchpadup | Touchpad released. | +| touchpadtouchstart | Touchpad touched. | +| touchpadtouchend | Touchpad not touched. | +| touchpadmoved | Touchpad moved. | | triggerchanged | Trigger changed. | | triggerdown | Trigger pressed. | | triggerup | Trigger released. | +### Legacy WebVR Browsers + +Legacy WebVR browsers use the older 'trackpadXXXX' event names, rather than the +[WebXR nomenclature](https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets/profiles) +'touchpadXXXX'. If you want to support both event types, then you can listen for both flavors of event names. + +```.js +el.addEventListener('touchpadchanged', yourHandler); +el.addEventListener('trackpadchanged', yourHandler); +``` + ## Assets - [Controller GLTF](https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf)