Chrome 在 android 上:touchevent 不适用于实体点击

Chrome on android: touchevent not work on a-entity click

提问的问题是:通过VR模式在手机上通过触摸点击点击事件 不适用于 android Chrome 79+。 换句话说,触摸启动事件不会在 VR 模式的实体上触发。 Google Vr 服务已安装并启用。

目标 a 实体在 Chrome 最新 79+ 中应该是可点击的 用户点击(移动设备的 VR 模式触摸点击)

整个代码的链接: 这里 2 配置简单的应用程序: https://4dkly.csb.app/(配置:保险丝 3.6 秒;但点击实体在 chrome vr 中不起作用) https://codesandbox.io/s/aframe-example-4dkly?fontsize=14&hidenavigation=1&theme=white

https://12k87.csb.app/(光标颜色为红色;保险丝已关闭,光标仍然不起作用)
https://codesandbox.io/s/aframe-example-12k87?fontsize=14&hidenavigation=1&theme=dark 能否请您看一下这个示例中的任何一个,并告诉您如何做,使 chrome 成为最新的 vr 模式触摸点击。 有什么新的好办法newapi也可以

这里是代码摘录

 <script src="https://aframe.io/releases/1.0.1/aframe.min.js"></script>

    <a-scene main> 
      <a-sphere position="0 2 -5" radius="1.25" color="#EF2D5E"> </a-sphere>
 <!-- ... -->

      <a-camera id="camera" camera rotation>
        <a-entity
          id="cursor"
          cursor="fuse:false"
          position="0 0 -1"
          material="color: #111;"

        >
        </a-entity>
      </a-camera>
//simple event on click 
 document.querySelector("a-box").addEventListener("click", () => {
   alert("box");
});```  

您描述的行为是正常的。当通过 WebXR 进入沉浸式模式时,浏览器会禁用触摸事件,因为 Chrome 79+ 和 https 上的内容就是这种情况。作品中有新的 API 可以在 AR 中呈现时实现交互。您可以在此博客中找到更多详细信息 post:https://aframe.io/blog/webxr-ar-module/

在没有原生 WebXR 实现的设备上,VR 模式依赖于全屏 API 并且可以使用触摸事件。

我不建议在 VR 中依赖屏幕输入并使用 fuse based cursor