Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
103.02k stars 10.01k forks source link

How does Virtual Display implement input event control? #4873

Open BarleyXu opened 3 weeks ago

BarleyXu commented 3 weeks ago

hi, great product! !

One question, I created Virtual Display on my android device. Then display a specified third-party application on the Virtual Display, which will not affect the display content of the home screen. Then I specify the display id through scrcpy --display. I can see the third-party application interface on the computer and can also do input event control. How is this achieved?

I am also sharing the content of virtual display to the browser through similar webrtc, but when I receive the browser event in Android and trigger the event through injectInputEvent,"I InputDispatcher: Dropping event because there is no touched foreground window appears. in display 34 or gesture monitor to receive it" arised in the Log. How to modify the event handling of virtual display?

hwf1324 commented 3 weeks ago

Hi

I would like to ask, what is the app you use to create a virtual display? I am very interested in it.

Thanks

BarleyXu commented 3 weeks ago

Hi

I would like to ask, what is the app you use to create a virtual display? I am very interested in it.

Thanks

Hi, I use the createVirtualDisplay method of MediaProjection