barry-ran / QtScrcpy

Android real-time display control software
https://blog.csdn.net/rankun1/article/details/87970523
Apache License 2.0
18.14k stars 2.46k forks source link

Keyboard controls and mouse controls stopped working #872

Open Akash9L opened 8 months ago

Akash9L commented 8 months ago

I have been using this tool for a while now to connect my phones and control them via keyboard and mouse to play games. Recently, the controls via keyboard and mouse have stropped working suddenly for all the connected devices. I have tried changing the cable, try different devices and also downgrading the version. But none of them have worked. My primary device is Pixel 6. I obviously have usb-debugging enabled and unlike Redmi devices I do not have the additional usb-debugging (security settings) option.

Edit 1: The logs do show the X and Y positions whenever I click anywhere on the screen. But the click is not working, The logs also keep showing following repeatedly, which makes me thing that my device is being reconnected/updated continously. Not sure if this is supposed to be this way.

" update devices... adb run AdbProcessImpl::out:List of devices attached 1B051FDF6009SF device " Can somebody help to resolve this issue. TIA.

Akash9L commented 7 months ago

Ran into this error recently

AdbProcessImpl::error:java.lang.AssertionError: java.lang.reflect.InvocationTargetException at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:65) at com.genymobile.scrcpy.Device.injectEvent(Device.java:195) at com.genymobile.scrcpy.Device.injectEvent(Device.java:199) at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:223) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:98) at com.genymobile.scrcpy.Controller.control(Controller.java:75) at com.genymobile.scrcpy.Server$3.run(Server.java:133) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:62) ... 7 more Caused by: java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:207) at android.hardware.input.InputManager.getInstance(InputManager.java:271)

This seems to be coming from underlying scrcpy I am using it on a pixel device with android 14. Seems like scrcpy was recently updated to support input control for android 14. Here is the link to the issue: https://github.com/Genymobile/scrcpy/pull/4075

I am assuming that if underlying scrcpy package is updated to latest, this issue may get solved.