leng-yue / py-scrcpy-client

An easy to use python scrcpy client
https://leng-yue.github.io/py-scrcpy-client/
MIT License
308 stars 76 forks source link

scrcpy shortcut commands not working #8

Closed JustinDBruce closed 3 years ago

JustinDBruce commented 3 years ago

I am trying to use some of the scrcpy shortcut commands, https://gist.github.com/csarron/b3ab1fc6e5e9da622d675c59137ef2a8

its only simulating keycode events for the device. Is there a way to have them work?

leng-yue commented 3 years ago

Please check the document, and https://github.com/leng-yue/py-scrcpy-client/blob/a8222520c09f968ad0449eba280a96e8bd95e29c/scrcpy_ui/main.py#L92-L130

JustinDBruce commented 3 years ago

Sorry, I'm not really understanding. I want to press ctrl+h on the keyboard and have it take me to the device home screen. I'm not understanding what I needs to do.

leng-yue commented 3 years ago

It's easy to make QT listens to ctrl+h. Then, what you need to do is send a press HOME key event. https://github.com/leng-yue/py-scrcpy-client/blob/a8222520c09f968ad0449eba280a96e8bd95e29c/scrcpy_ui/main.py#L76-L77