Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.76k stars 10.47k forks source link

Keyboard input from any python script is not working #1996

Open stadnico opened 3 years ago

stadnico commented 3 years ago

Environment

Describe the bug Pressing on a real keyboard results in a registered input, however sending keys via python with e.g pyautogui is not being recognized. Im getting no errors, it simply just doesnt type any char. Tested input with pyautogui with a browser, worked fine.

rom1v commented 3 years ago

Scrcpy receives input events via SDL.

stadnico commented 3 years ago

But how do I then control scrcpy with python?

TannerOlason commented 3 years ago

My problem was similar to this. I was able to type numbers and symbols, but not letters.

Using these flags worked for me.

scrcpy --prefer-text

kinnplh commented 7 months ago

My problem is also similar to this. I cannot programmatically copy a string from my pc to my phone with pyautogui.hotkey('ctrl', 'v'). If I manually press ctrl+v it works fine. I have not found a solution.