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

Bug copying from application and pasting to pc! :( #1056

Closed
cruzado92 opened this issue Jan 2, 2020 · 12 comments
Closed

Bug copying from application and pasting to pc! :( #1056

cruzado92 opened this issue Jan 2, 2020 · 12 comments

Comments

@cruzado92
Copy link

I can't copy text messages inside the app and paste it to my computer, even using the ctrl + shift + v commands.
Already tested on various android devices and windows.
Help me Please...

@rom1v
Copy link
Collaborator

rom1v commented Jan 2, 2020

First, you need to select the text on the device, then click on Copy (on the device). This copies the text to the clipboard (scrcpy is not involved).

Then, press Ctrl+c in scrcpy to copy the device clipboard to the computer clipboard.

Finally, press Ctrl+v on your computer where you want to paste.

This is not straightforward, but unfortunately, we can only access the computer clipboard, not retrieve the content of a selection directly.

@cruzado92
Copy link
Author

Any suggestions on how to do or what to use?

@rom1v
Copy link
Collaborator

rom1v commented Jan 3, 2020

If you do what I just described, it doesn't work?

What is the output in the console?

@cruzado92
Copy link
Author

Still struggling, it works the first time, and not as sequents, pasting even if the first message copied on the device...

@igorwojda
Copy link

This "double copy" is quite unintuitive. Can't we simply automatically copy device<->pc clipboards? - each time ANdroid clipboard changes we update system clipboard and vice versa

@rom1v
Copy link
Collaborator

rom1v commented May 20, 2020

This "double copy" is quite unintuitive.

Yes, it is.

Can't we simply automatically copy device<->pc clipboards? - each time ANdroid clipboard changes we update system clipboard and vice versa

AFAIK, there is no way to be notified of clipboard change on Android. (Reading it every 500ms for example is too ugly for something used very occasionally.)

Anyway, the behavior could be surprising: if I plug my device and run scrcpy (and let it open). I take my device in hands, do some stuff, copy text, etc. Then I go back to my computer, I don't expect the content of my computer clipboard to contain what I did on the phone.

@igorwojda
Copy link

I think there is a way to listen for clipboard change
http://edgedevstudio.blogspot.com/2018/10/clipboard-broadcast-listen-to-changes.html

Mabye we should think about "scrscpy support app//service" that runs on the device and enables better integration? And enable/disable this "sync clipboard" option when needed?

@rom1v
Copy link
Collaborator

rom1v commented May 20, 2020

I think there is a way to listen for clipboard change
http://edgedevstudio.blogspot.com/2018/10/clipboard-broadcast-listen-to-changes.html

Thank you, I added it to my TODO list, I will investigate later.

@rom1v
Copy link
Collaborator

rom1v commented May 20, 2020

@igorwojda I wrote a quick PoC to validate that it works in the context of scrcpy: it works.

Hopefully, I will implement this soon (maybe next week?).

rom1v added a commit that referenced this issue May 23, 2020
Automatically synchronize the device clipboard to the computer any time
it changes.

This allows seamless copy-paste from Android to the computer.

Fixes #1056 <#1056 (comment)>
rom1v added a commit that referenced this issue May 23, 2020
Automatically synchronize the device clipboard to the computer any time
it changes.

This allows seamless copy-paste from Android to the computer.

Fixes #1056 <#1056 (comment)>
@rom1v
Copy link
Collaborator

rom1v commented May 23, 2020

@igorwojda I just implemented it. Please test #1423.

@rom1v rom1v closed this as completed in acc4ef3 May 27, 2020
@igorwojda
Copy link

Works great! THX
Now we need 2nd direction equivalent -> "Implement seamless copy-paste from computer to Android"

Should I open the issue?

@rom1v
Copy link
Collaborator

rom1v commented Jun 18, 2020

@igorwojda In v1.14, it should work: https://github.com/Genymobile/scrcpy/releases/tag/v1.14

It will be improved by #1465.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants