Genymobile / Genymobile/scrcpy

HID/OTG for localhost Android device to enable IME input

Open
#3,913 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [x ] I have checked that a similar [feature request](https://github.com/Genymobile/scrcpy/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) 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
/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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with doc/hid-otg.md and the --hid-keyboard invocation described in the issue, then trace how the localhost:5555 device is handled. Done means a documented parameter enables HID input for a virtual Android device without a physical USB connection; the issue does not name an implementation file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.