如何使用 aframe daydream 触控板控件?

How to use the aframe daydream trackpad controls?

我正在尝试在框架中使用 Daydream 触控板。特别是我需要让我将其视为触摸板的事件。换句话说,我需要 touchstart、touchmove 和 touchend 事件或等效事件。

docs只列出这些事件

trackpadchanged     Trackpad changed.
trackpaddown        Trackpad pressed.
trackpadup          Trackpad released.
trackpadtouchstart  Trackpad touched.
trackpadtouchend    Trackpad not touched.

注意没有 trackpadmovetrackpadtouchmove。我尝试向 trackpadchanged 添加一个事件,但它不是类似 touchmove 的事件。

如果我想说 "scroll through something" 我需要用户在触控板上移动手指时的值。

我尝试打印出所有这些事件

const dd = this.el.querySelector('#daydream-controls');
[
  'trackpadchanged',
  'trackpaddown',
  'trackpadup',
  'trackpadtouchstart',
  'trackpadtouchend',
].forEach((event) => {
  dd.addEventListener(event, (e) => {
    console.log(event, e);
  });
});

但是当我在触控板上拖动手指时,我没有看到任何事件。我只看到 trackpadtouchstart 后跟 trackpadchanged 当我触摸垫然后我看到 trackpadtouchend 后跟 trakpadchanged 当我释放时。

当用户在触控板上移动手指时,我是否应该寻找其他事件或以其他方式读取?

使用底层tracked-controls提供的axismove事件。

另请参阅:https://www.npmjs.com/package/aframe-thumb-controls-component