macpaste icon indicating copy to clipboard operation
macpaste copied to clipboard

Various behavior changes that work better for me

Open josephlbarnett opened this issue 4 months ago • 16 comments

Only paste on middle button press ie, ignore side buttons like forward/back

Also don't paste unless the cursor is an ibeam, aka is hovering over a text field. Should let the middle button work for eg browser links in new tab hopefully

Only copy on drag if we've dragged more than 5 px away Prevent spurious copys on click while moving the mouse slightly

Don't copy on double click Only copy when dragging to highlight, to make the highlight -> double click -> paste use case more useful

~~Copy on triple click Instead of copy on double click, do copy on triple click because that's unlikely to be followed by an immediate paste, but does highlight eg browser url bar which is usually worth a copy.~~

Manage a separate paste buffer for middle click When we copy, save the current clipboard prior to copying, then when we notice the clipboard change, store that clipboard in a separate pasteItems and restore the old clipboard. When we paste via middle button, set the clipboard to the stored pasteItems, and when we can set the clipboard back to the saved current clipboard. Because of that, restore copy-on-double-click behavior, as the typical patterns work well with a separate clipboard and selection buffer. There's still a little bit of a race if you select/paste too fast though?

josephlbarnett avatar Feb 22 '24 22:02 josephlbarnett