engine icon indicating copy to clipboard operation
engine copied to clipboard

Clipboard support

Open danaugrs opened this issue 6 years ago • 1 comments

Allow copying, cutting, and pasting text.

danaugrs avatar Sep 06 '19 15:09 danaugrs

If you just want strings/text, there is this small go package called clipboard it supports darwin, unix and windows 7+. For unix and darwin builds it relies on os.Exec calls, and for windows straight syscalls.

But accessing raw binary data from the clipboard could be a surplus (like copying images from the web browser i.e), it would be a big task and requires platform, and for linux even display server, specific cgo code.

Some notes for unix, you'll need a third party command line tool (xsel, xclip, wl-clipboard or termux), or it will return empty strings, some info. My clean ubuntu install for example, had none of those packages installed by default.

If you want I'll implement this package or rewrite if you don't want this project to be dependent of other projects.

I also suggest to add an OnClipboardChange event to it. However what seems an healthy frequency to check for changes?

MrWaggel avatar Feb 14 '20 04:02 MrWaggel