Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.58k stars 10.45k forks source link

intent for clipboard #413

Closed amosbird closed 5 years ago

amosbird commented 5 years ago

Hi, shall we have scrcpy handle some intent to get/set android clipboard directly instead of using keyboard event to copy/paste? https://stackoverflow.com/questions/14243427/set-clipboard-text-via-adb-shell-as-of-api-level-11

It also makes copy from android possible.

rom1v commented 5 years ago

IIUC, this allows to read from and write to the clipboard, not to actually generate the events (e.g. write text to the focused text field)?

It also makes copy from android possible.

ping #145

npes87184 commented 5 years ago

IIUC, this allows to read from and write to the clipboard, not to actually generate the events (e.g. write text to the focused text field)?

IMO, it is a good idea to transfer keysym to android, where the keysym cannot be simply decomposed. Such as Chinese words.

It also makes copy from android possible.

ping #145

amosbird commented 5 years ago

pasting into android is easy and works as expected. However I haven't figured out a way to automatically copy the text from android when the clipboard is changed. Currently I use Ctrl-c to grab the content directly. The intents are injected into the gnirehtet project for PoC only...

https://github.com/amosbird/gnirehtet https://github.com/amosbird/scrcpy

rom1v commented 5 years ago

Implemented on dev branch. See https://github.com/Genymobile/scrcpy/issues/145#issuecomment-497484917.