是否可以从应用程序 copy/paste/type(例如密码)输入 Oculus Quest 耳机?

Is it possible to copy/paste/type (eg. a password) from an app into the Oculus Quest headset?

目前似乎没有一种简单的方法可以在 Oculus Quest 中 copy/paste 文本,也没有一种简单的方法可以 'type' 到配套应用并将其发送到耳机中(至少我见过)。这使得从密码管理器等输入复杂密码变得极具挑战性。

我读过一些文章说可以将蓝牙键盘与耳机配对,这会稍微好一些,但仍然不允许我从密码管理器copy/paste。

有人知道实现这个的方法吗?

经过一些 Googling/SO 之后,似乎也可以使用 Android Debug Bridge (adb) (Oculus has their own help page 来实现)

你的设备 needs to be in developer mode 才能正常工作:

  1. Create/join an organisation in the Oculus Dashboard
  2. 在您的手机上打开 Oculus 应用 phone。
  3. 在“设置”菜单中,select 您用于开发的 Oculus Quest 耳机。
  4. Select更多设置。
  5. 打开开发者模式。

如果您在 macOS 上使用 homebrew,您可以安装 adb

brew cask install android-platform-tools

接下来,使用 USB-C 数据线将耳机插入计算机。然后您应该能够列出连接的设备:

adb devices

如果显示 'unauthorized',请在耳机中检查一个对话框,请求连接权限。勾选 'always allow' 以后会更容易。

至此,我们应该可以向设备发送文本了。在耳机中,将您想要 'type' 的区域聚焦,然后 use adb shell input to 'type' your text:

adb shell input text "sometext"

似乎也可以 使用 adb shell input keyevent:

adb shell input keyevent 279

在旧的 Android 设备中,您可以 send a 'copy' command 以类似的方式,但这已被弃用:

service call clipboard 2 i32 1 i32 0 s16 "text"

似乎在较新的设备上, (eg. Clipper) 到 'copy to clipboard'。使用 Clipper,您可以在 adb shell 中发送命令,例如:

am broadcast -a clipper.set -e text "text"

are many different inputs we can send using these methods. You can find a full list of KeyEvent's in the Android Developer Documentation.

使用其中一种(或多种)方法,应该可以将 'copy'/'paste'/'type' 密码存储在您计算机上的密码管理器中 'into' Oculus Quest 耳机。