bk138 / droidVNC-NG

VNC server app for Android that does not require root privileges.
GNU General Public License v2.0
1.36k stars 200 forks source link

Feature: Server-to-client copy/paste would be nice #106

Open KJ7LNW opened 2 years ago

KJ7LNW commented 2 years ago

Is your feature request related to a problem? Please describe.

I am unable to copy from Android and paste locally to my desktop.

Describe the solution you'd like

Support copy-paste of plain-text content

Describe alternatives you've considered

Even if I have to paste the text into a "clipboard transfer" box on the droidVNC-NG app itself, that would be ok, but even better if you can transfer the clipboard as soon as text is copied!

Additional context

If this is actually known to work, then let me know I should troubleshoot.

Thanks!

bk138 commented 2 years ago

Please see the third bullet point in https://github.com/bk138/droidVNC-NG#features: Android keeps services/apps from getting clipboard data. We could have the "clipboard transfer" box you suggested, that would work but probably be not very good UX :-/

I'm keeping this open as it might relate to #4

KJ7LNW commented 2 years ago

Interesting point.

I'd like to highlight this from the original post above:

Even if I have to paste the text into a "clipboard transfer" box on the droidVNC-NG app itself, that would be ok, but even better if you can transfer the clipboard as soon as text is copied!

This was my case:

I used my phone to scan a QR code with TOTP keys, but wanted to securely transfer the (very long) key to my desk without re-typing it. So I setup ssh forwarding and tried droidVNC-NG hoping clipboard would work.

For this example I would be fine pasting it into a dedicated "clipboard" textarea of the droidVNC-NG app itself, so it fills the clipboard on my VNC desktop client, so I can paste to my desk.

freebrowser1 commented 1 year ago

Weird, for me this did work. Using RealVNC viewer on macOS copying text from Android (OnePlus 6 running Android 10) to my Mac did work.

ElishaAz commented 1 year ago

KDEConnect solved the Android 10 problem by opening an invisible activity that retrieves the clipboard: https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/ClibpoardPlugin/ClipboardFloatingActivity.java This can only be done on-demand, but is still much better than having to paste it into a text field

bk138 commented 5 months ago

Note to self: https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED