Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
112.26k stars 10.73k forks source link

[Dev-Question] How a linux command program transform touch message? #5402

Open Lioncky opened 3 weeks ago

Lioncky commented 3 weeks ago

A excuteable ELF program(start by main function) without JVM environment can't deal message from scrcpy. What should I do to get and transform message?

So far I listen the system /dev/input/eventXX , seems adb touch message wasn't pass to there.

rom1v commented 3 weeks ago

SDK events are probably handled at a higher level than uinput.

You should be able to read mouse and keyboard injected via UHID (scrcpy -KM) by reading /dev/input… on the device I think (not tested).

Lioncky commented 3 weeks ago

SDK events are probably handled at a higher level than uinput.

I've test scrcpy -M --otg -s HA1WW7PA, the cursor appeared but still can't pass to /dev/input

A nice way to pass messages is launch scrcpy-server as root and pass by write /dev/input event instead of using SDK I think, emm it's a feature maybe.