HID/OTG for localhost Android device to enable IME input
- [x ] I have checked that a similar feature request does not already exist.
Is your feature request related to a problem? Please describe.
I would like to use --hid-keyboard but with a virtual device (ReDroid; Android in docker container) running on the same machine as scrcpy. So there is no real USB connection and thus it currently falls back (as described here https://github.com/Genymobile/scrcpy/blob/master/doc/hid-otg.md):
scrcpy -s localhost:5555 --window-width 400 --audio-codec=aac --audio-encoder='OMX.google.aac.encoder' --hid-keyboard
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 483.0 MB/s (52867 bytes in 0.000s)
[server] INFO: Device: redroid redroid12_x86_64 (Android 12)
ERROR: Could not find USB device localhost:5555
ERROR: 0000:2d:00.3 (1d6b:0003) Linux 6.2.8-x64v1-xanmod1-1 xhci-hcd xHCI Host Controller
ERROR: 31C6BCA0 (046d:0825) (null) (null)
ERROR: 0000:2d:00.3 (1d6b:0002) Linux 6.2.8-x64v1-xanmod1-1 xhci-hcd xHCI Host Controller
ERROR: 0000:02:00.0 (1d6b:0003) Linux 6.2.8-x64v1-xanmod1-1 xhci-hcd xHCI Host Controller
ERROR: A02020051203 (1462:7c94) MSI MYSTIC LIGHT
ERROR: 0000:02:00.0 (1d6b:0002) Linux 6.2.8-x64v1-xanmod1-1 xhci-hcd xHCI Host Controller
ERROR: Fallback to default keyboard injection method (-K/--hid-keyboard ignored)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 22.3.4
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2160
[server] WARN: Could not inject char u+3063
Describe the solution you'd like A parameter that can be added to make --hid-input functionality work for that case.
Describe alternatives you've considered Installing "Fcitx5 For Android" on my device but it's by far not ready yet.
Additional context I use the input method framework fcitx5 on my Arch Linux desktop. I switch layouts pretty often which only takes a simple key shortcut.
I also need this feature under wireless. As a Chinese, I want to select the candidate for the PinYin input method.