macpaste icon indicating copy to clipboard operation
macpaste copied to clipboard

Various behavior changes that work better for me

Open josephlbarnett opened this issue 1 year ago • 18 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

Not sure but the repo looks zombie. I would like to follow more in your own repo. Keep us updated.

insign avatar Feb 28 '24 02:02 insign

Working fine to me. Thank you. Sonoma M2

insign avatar Feb 28 '24 02:02 insign

To use with my macbook trackpad I use it together with https://github.com/artginzburg/MiddleClick-Sonoma

insign avatar Feb 28 '24 02:02 insign

Can you run the copy action when there is text to copy? The Force Touch is running all the time with nothing to copy 😢

insign avatar Feb 29 '24 04:02 insign

Of course, if possible using its own clipboard would make it a masterpiece because sometimes as dev I copy something and select another to delete then paste. But I paste exactly what I deleted. 🫠

insign avatar Feb 29 '24 04:02 insign

not sure what you mean about Force Touch, but certainly possible i messed something up with that last commit. i see the copy working pretty much how I want it to at this point, but could be missing something.

the paste what i want to overwrite problem is a bad one for sure, not sure if something like flycut running in conjunction with this would be a decent solution?

josephlbarnett avatar Feb 29 '24 16:02 josephlbarnett

I just want to disable the copy on force click at trackpad, IDK why but when I force click (real click on trackpad) it acts like middle click....

insign avatar Feb 29 '24 23:02 insign

UPDATE: I pulled your last update from this PR and now it pastes twice 😭

insign avatar Mar 01 '24 00:03 insign

Why triple click is important if double will already select?

insign avatar Mar 07 '24 00:03 insign

its my attempt to avoid the "as dev I copy something and select another to delete then paste. But I paste exactly what I deleted" problem -- I usually double click to select a variable to paste over, so don't want that double click to copy. but my browser does a triple click to select the full URL, so do want that to copy. YMMV

josephlbarnett avatar Mar 07 '24 00:03 josephlbarnett

I’m not the owner but thank you for this great changes. By not messing with the main clipboard is such an amazing change. Ever.

insign avatar Mar 21 '24 00:03 insign

~~Just tested, not sure if I understood but the clipboard keeps the same, one single buffer :/~~ MY ERROR: not checked out only-center-button-press branch.

For now looks amazing!

insign avatar Mar 26 '24 19:03 insign

@josephlbarnett I usually take screenshots with main button (right click drag then release) but are being blocked by the macpaste, so the image does not go to the clipboard, keeps the previous text.

insign avatar Mar 26 '24 19:03 insign

After two days I need to say that this is almost stable, thanks again!

insign avatar Mar 28 '24 12:03 insign

haha yes, almost stable indeed -- seems like some amount of highlight, pause and move mouse, command+c copy, pause and move mouse, ok go ahead and work normal works most of the time, but the race condition there is a little maddening. not sure about the screenshot workflow or if I can do anything to avoid the blockage (at this point it shouldn't affect any right clicks, just left and middle clicks).

josephlbarnett avatar Apr 01 '24 17:04 josephlbarnett

@josephlbarnett the problem is not about taking screenshots itself but the act of click drag to the area then drop. The macpaste probably understands as a selection drag and drop.

insign avatar Apr 01 '24 20:04 insign

@josephlbarnett Great work, I'm using your fork and I'm super pleased with the behaviour. It's sad that project is stale and this couldn't reach broader audience.

serapch avatar Aug 01 '24 08:08 serapch