Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
106.26k stars 10.29k forks source link

UHID keyboard - IME benefits question #4722

Open nr1995 opened 4 months ago

nr1995 commented 4 months ago

Hi, It says in your docs that UHID lets you used IME's in a new and better way than ever before. I use Chinese IME in Windows all the time, but switching input languages on my phone isn't so smooth. Can you explain what this new improved method of (e.g.) Chinese input is? How it works or how to use it with SCRCPY? Thanks!

rom1v commented 4 months ago

The UHID feature basically behaves the same as plugging (on connecting via bluetooth) a physical keyboard to the device.

I have no experience with ~Chinese~ Japanese IME (I'm French), so maybe @yume-chan (or others) may give more details.

But for now, here is a video someone posted on Twitter, which shows what typing Chinese on Android from scrcpy 2.4 looks like: https://twitter.com/amatetest/status/1764625600512499714

yume-chan commented 4 months ago

I only use Gboard and don't have any issue with SDK injection.

Based on #1055, some Chinese IMEs (including Sogou, TouchPal and others) don't respond to SDK injection, but work correctly with physical keyboards (over USB or Bluetooth) and AoA injection (the old --hid-keyboard option).

Like AoA injection, the new UHID injection method also simulates a physical keyboard (similar to plugging in your PC keyboard directly into the Android device). But unlike AoA injection, it works on Windows (while mirroring) and TCP/IP (ADB over Wi-Fi). This is the main benefit of UHID injection.

which shows what typing Chinese on Android from scrcpy 2.4 looks like: https://twitter.com/amatetest/status/1764625600512499714

(This is Japanese, not Chinese)

I use Chinese IME in Windows all the time,

UHID keyboard simulates a physical keyboard, it doesn't work directly on IME level. It can't take inputs from Windows IME and inject Chinese characters into Android system. That requires installing a custom IME app on Android, which is a different feature request.