Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intent for clipboard #413

Closed
amosbird opened this issue Jan 27, 2019 · 4 comments

Comments

@amosbird
Copy link

commented Jan 27, 2019

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

This comment has been minimized.

Copy link
Collaborator

commented Jan 29, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2019

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

@rom1v rom1v added the input events label Feb 5, 2019

@amosbird

This comment has been minimized.

Copy link
Author

commented Feb 7, 2019

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

@amosbird amosbird closed this Feb 7, 2019

rom1v added a commit that referenced this issue May 30, 2019
Implement computer-to-device clipboard copy
It was already possible to _paste_ (with Ctrl+v) the content of the
computer clipboard on the device. Technically, it injects a sequence of
events to generate the text.

Add a new feature (Ctrl+Shift+v) to copy to the device clipboard
instead, without injecting the content. Contrary to events injection,
this preserves the UTF-8 content exactly, so the text is not broken by
special characters.

<#413>
@rom1v

This comment has been minimized.

Copy link
Collaborator

commented May 30, 2019

Implemented on dev branch. See #145 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.