microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.19k stars 6.44k forks source link

X Clipboard (select to copy, middle click to paste) #14

Open scottven opened 5 years ago

scottven commented 5 years ago

Select to copy, middle click to paste

PowerWindowsXP commented 5 years ago

Uhm, do you mean scroll click?

jaimecbernardo commented 5 years ago

Hi @scottven , Could you please add some details to this suggestion? It's not clear what this PowerToy would do.

scottven commented 5 years ago

Any time the mouse is used to select text, the PowerToy would automatically copy that selection to the clipboard. Any time the middle (scroll wheel) button is clicked, it would paste.

belg4mit commented 5 years ago

Hi @scottven , Could you please add some details to this suggestion? It's not clear what this PowerToy would do.

I believe the issue is for a new tool inspired by Xwindows behavior, like Xmouse. If this were to be implemented, I would recommend going all the way, and including a clipboard manager which supports access to previous clipboard entries. This could be further extended to be a more Windows-y tool by allowing one to access individual OLE variants (or whatever they're dubbed) in the clipboard e.g; when copying an object in some software (such as SPSS), multiple forms of the object (PNG, HTML, text) may be placed in the clipboard.

jpinkham commented 5 years ago

+1 I’ve always liked Xwindows’ ability to do this (auto-copy to clipboard upon highlight) and would like to see it in Windows. Also, having easy access to previous clipboard entries would be a big win.

jaimecbernardo commented 5 years ago

Hi @jpinkham , You can already enable and use Clipboard History by using the "Windows Key + V" keyboard shortcut.

lordlycastle commented 5 years ago

Check out #127. Which is a much better implementation of this. Copy on select is not a good idea as it would clutter the clipboard/clipboard manager.

scottven commented 5 years ago

Check out #127. Which is a much better implementation of this. Copy on select is not a good idea as it would clutter the clipboard/clipboard manager.

That looks interesting, but I've spent too long living with X clipboard behavior that anything else is just a hassle to use.

lordlycastle commented 5 years ago

@scottven If #127 is implemented as I've explained then you should be able to write a custom script to copy to clipboard on select. I do believe this is a behaviour a lot people would not want, especially someone who uses clipboard manager. Or someone working in an IDE, I select a lot of stuff all day long. Or people who do have middle mouse button (e.g. trackpad).

Only people I see wanting this, is whose job includes a lot of sequential copy-paste. As personally majority of the time I do not copy all the stuff I select. Those people could also hugely benefit by using a clipboard manager imo.

This comment did remind me of this :) xkcd

jpinkham commented 5 years ago

@lordlycastle i mis-stated in my previous comment (mentioning clipboard) when I now realized a key piece of information is missing from this discussion, which may help you understand why this request isn’t silly: the buffer used by xwindows for highlighting text is NOT the clipboard. THIS is the behavior that we are looking for. We want an immediate paste ability of highlighted selection, without necessarily cluttering the clipboard history (but this should be a config option). I have used and loved this feature of xwindows for 20 years.

To get highlighted text into the clipboard buffer, the user must explicitly request to copy it (ex: ctrl+c).

Reference: https://linux.die.net/man/1/xsel

Reference: “Clipboard” section of https://en.m.wikipedia.org/wiki/X_Window_selection

jpinkham commented 5 years ago

@jaimecbernardo: Thanks for the info on Win+V. I determined I don’t have clipboard history because my company’s laptops are using an older build of win10, before this functionality was added.

crutkas commented 4 years ago

Hi friends, i'm trying to better understand this and the end to end scenario(s). First, @jpinkham, great insight here, thanks for helping provide a lot of background info here!

  1. On windows in a Terminal setting, CMD and Windows Terminal, Right click will both copy and paste.
  2. Scroll wheel click leads to issues of unintentional scrolling, no?
  3. what if the user has a trackpad? A trackball?
  4. Is this for terminal or all applications?
    1. if it is all, how would this work in an application like Adobe Photoshop or Illustrator?
  5. what is the scenario for two different clipboards, a ctrl-c and then the highlight copy style one

Or is the underlying ask here, clone X Window clipboard? https://en.m.wikipedia.org/wiki/X_Window_selection#Clipboard

scottven commented 4 years ago

My original ask is exactly a clone of XWindows. Answering your specific questions:

  1. well, this one isn't a question. :)
  2. no, I can't say this has ever been a problem. Though this should probably disable the middle-click mouse movement scrolling behavior.
  3. My trackpad has 3 clickable buttons on it. So does my trackball. And I'm not asking to get rid of Ctrl-V for people who want to keep using that.
  4. All applications. It might not work for graphics elements, but it will work for any application that has text (browser, email, Word, etc.)
  5. I'm actually ok with having the selection buffer be the same as the clipboard, as I had been using a utility called TrueXMouse to get it in Windows, but a recent update to Outlook broke it. But I can appreciate not wanting to clutter clipboard history so I'm totally ok with a more faithful reproduction of how XWindows works.
jpinkham commented 4 years ago

I’m looking for a reproduction of the XWindows version, using a separate buffer. This wouldn’t affect the existing Ctrl-C/Ctrl-V behavior that everyone is used to, and wouldn’t clutter that traditional clipboard buffer.

I use a trackpad on my laptop and desktop, set (in my terminal app) to use a middle-click for paste (which is mapped to a three finger single tap). I’m not sure I understand the question/concern for non-mouse users.

For me, I’d only need to see this feature work in terminal/cmd and PowerShell.

cowens commented 4 years ago
  1. I commonly copy examples from web pages, so the fact that terminal supports keyboardless copy and paste is only part of the solution
  2. If you use a crappy mouse, yes. But good mice like the Logitech MX Anywhere 2s have dedicated middle click buttons and any good mouse has multiple buttons that can have middle click assigned to them. Additionally, Linux also supports middle click emulation for mice that don't have a middle click button: clicking both the left and the right mouse buttons triggers the same behaviour as middle click.
  3. Trackpads often have a gesture to trigger middle click; trackballs typically have a middle mouse click button.
  4. It is for text in all applications. In X Windows you can highlight any text and it is set to the primary selection (which is distinct from the clipboard, hitting ctrl-c or ctrl-shift-c in a terminal will copy the primary selection to the clipboard) . Middle clicking will paste the primary selection.
  5. The primary ask in my ticket that was marked as dup of this ticket was to clone the X Windows behavior as it is very useful (having a ephemeral text in the primary selection and a second more import chunk of text in the clipboard is a common thing I do)
dermoth commented 2 years ago

Hey just my 2 cents on this...

  1. I used in the past a tool that would do this - enable focus follow mouse, copy on select, paste on middle-click. IIRC there were some blacklisted windows, terminal emulators for instance. I think even for the browser it worked better if I disabled it and use a browser extension for that instead, probably to avoid issue with middle-clicking links or selecting when the browser auto-highlight the url bar (on unix it doesn't copy to the clipboard) I'll let you know if I find back that tool...
  2. I'm wondering if there is any way the PRIMARY/CLIPBOARD behavior could be emulated too - and in particular if it could be integrated with X servers like VcXsrv. A selection would go in PRIMARY only and that is what would be pasted from middle-click, while ctrl-c updates the clipboard instead (and usually primary unless using a button to copy something directly to the clipboard)
vikke1234 commented 2 years ago

Would be nice if it was in a separate clipboard from c-v & c-c.

tstandley commented 1 year ago

This might be what's keeping me from switching back to Windows. Windows is much more stable with Nvidia. But I really can't stand not being able to middle-click to paste.

baxyz commented 1 year ago

Will be really pleased with this feature too.

In the meantime, there is a utility that already allows you to do this on Windows: http://fy.chalmers.se/~appro/nt/TXMouse/

rpmonti commented 1 year ago

If implemented, it would be great if the "middle-click to close tab" behavior and "open link in new tab" of most web browsers were preserved (both are lost when using TXMouse).

KingPsychopath commented 7 months ago

Any updates on this? Just in terms of productivity alone this would be a great QoL change.

SailingPhysics commented 6 months ago

This lack of copying to primary selection, and then pasting primary selection with middle click, is the feature that is really holding me back from using Windows as my development OS. I have been searching for a working solution for years

angelandujar commented 2 months ago

Will be really pleased with this feature too.

In the meantime, there is a utility that already allows you to do this on Windows: http://fy.chalmers.se/~appro/nt/TXMouse/

It really works! Thank you so much!