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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 19:21:27

问题


Currently there doesn't seem to be an easy way to copy/paste text in the Oculus Quest, nor to 'type' into a companion app and have it sent into the headset (at least that I have seen). This makes it extremely challenging to enter complex passwords from password managers, etc.

I have read some articles that say it might be possible to pair a bluetooth keyboard with the headset, which would be slightly better, but still doesn't allow me to copy/paste from my password manager.

Does anyone know of a way to achieve this?


回答1:


After some Googling/SO'ing, it seems like this might be possible using the Android Debug Bridge (adb) (Oculus has their own help page for it as well)

Your device needs to be in developer mode for this to work:

  1. Create/join an organisation in the Oculus Dashboard
  2. Open the Oculus app on your mobile phone.
  3. In the Settings menu, select the Oculus Quest headset that you’re using for development.
  4. Select More Settings.
  5. Toggle Developer Mode on.

If you're using homebrew on macOS, you can install adb with:

brew cask install android-platform-tools

Next, plug your headset into your computer with the USB-C cable. You then should be able to list connected devices:

adb devices

If it says 'unauthorized', check in the headset for a dialog box asking for permission to connect. Ticking 'always allow' will make this easier in future.

At this point, we should be good to send text to the device. In the headset, focus a field that you want to 'type' into, then use adb shell input to 'type' your text:

adb shell input text "sometext"

It seems it is also possible to send a 'paste' command using adb shell input keyevent:

adb shell input keyevent 279

In older Android devices, you could send a 'copy' command in a similar way, but this has since been deprecated:

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

It seems that on newer devices, you need to leverage an external service (eg. Clipper) to 'copy to clipboard'. Using Clipper, you can send a command in adb shell such as:

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

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

Using one (or more) of these methods, it should be possibly to 'copy'/'paste'/'type' passwords stored in a password manager on your computer 'into' the Oculus Quest headset.



来源:https://stackoverflow.com/questions/56386237/is-it-possible-to-copy-paste-type-eg-a-password-from-an-app-into-the-oculus-q

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!