rioj7 / select-by

Visual Studio Code extension to select text by criteria like Regular Expressions
18 stars 4 forks source link

Good idea for feature request make functionality for users of clipboard software... #24

Open mjoe67886 opened 11 months ago

mjoe67886 commented 11 months ago

I found out the only way to truly be a power developer is to use the copyQ Clipboard software it's totally awesome I have tons of code snippets in there i'm constantly using it to remember things I've copied and to paste them in quickly if you made your functionality so it would when using this software automatically select on a paste that would offer a lot more power to your end users you could put a note On your new functionality with a link where to get the software because it truly is the best clipboard software i've ever used...

rioj7 commented 11 months ago

@mjoe67886 I have no clue what you suggest.

Describe step by step what you suggest and what you expect to happen.

mjoe67886 commented 11 months ago

What I do is I have my clipboard software setup as my middle mouse button or actually the button above my middle mouse button on my RAZER Mouse so I open it with that and then I click a code snippet you know after selecting the place where I'd like to paste it and double click and it gets pasted in so what I would do is if you could set up some sort of automated process that whenever any code is pasted and you've selected a setting in your settings panel then it would get automatically, selected on paste that's what I mean... Just anywhere we could save button clicks you know then we'll have all that extra strength to focus on saving that next button click..

On Tue, Nov 21, 2023 at 9:15 AM rioj7 @.***> wrote:

@mjoe67886 https://github.com/mjoe67886 I have no clue what you suggest.

Describe step by step what you suggest and what you expect to happen.

— Reply to this email directly, view it on GitHub https://github.com/rioj7/select-by/issues/24#issuecomment-1821335371, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWFQGINKB2MPE7HYIJLV2VTYFTOTXAVCNFSM6AAAAAA7UV6GNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRGMZTKMZXGE . You are receiving this because you were mentioned.Message ID: @.***>

rioj7 commented 11 months ago

@mjoe67886 It depends for the snippet is inserted/pasted in the current application.

Most likely the Clipboard App inserts the text in the keyboard buffer with an OS/Desktop hook. This way you don't have to know anything how the active application is handling copy/paste after the Clipboard application closes it window and gives focus to the active application.

If done that way there is now way to detect if it is a snippet or somebody typing very fast. It does not use the OS-Clipboard and initiate a Paste operation in the active application.

Have you looked at the source code of the Clipboard App how it inserts the snippet in the application?

mjoe67886 commented 11 months ago

I wouldn't know how to do that but it's called copyQ And it's on Github if you wanted to check it out...

On Wed, Nov 22, 2023 at 6:08 AM rioj7 @.***> wrote:

@mjoe67886 https://github.com/mjoe67886 It depends for the snippet is inserted/pasted in the current application.

Most likely the Clipboard App inserts the text in the keyboard buffer with an OS/Desktop hook. This way you don't have to know anything how the active application is handling copy/paste after the Clipboard application closes it window and gives focus to the active application.

If done that way there is now way to detect if it is a snippet or somebody typing very fast. It does not use the OS-Clipboard and initiate a Paste operation in the active application.

Have you looked at the source code of the Clipboard App how it inserts the snippet in the application?

— Reply to this email directly, view it on GitHub https://github.com/rioj7/select-by/issues/24#issuecomment-1822843087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWFQGIMDKI7M2WLKXJUPP6TYFYBPXAVCNFSM6AAAAAA7UV6GNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSHA2DGMBYG4 . You are receiving this because you were mentioned.Message ID: @.***>

rioj7 commented 10 months ago

@mjoe67886 Looking at the code of copyQ it looks like it:

https://github.com/hluk/CopyQ/blob/6ebfa1b0336b4217002932341f06af5b6ee95dc2/src/gui/mainwindow.cpp#L3282 https://github.com/hluk/CopyQ/blob/6ebfa1b0336b4217002932341f06af5b6ee95dc2/src/gui/mainwindow.cpp#L985

  1. copies the snippet to the clipboard
  2. hide the copyQ window
  3. execute the Paste command of the current application (have not found that code, stopped at emit changeClipboard(data))

What happens if you redefine the Ctrl+V key binding to use selectby.pasteClipboard

 {
    "key": "ctrl+v",
    "when": "editorTextFocus",
    "command": "selectby.pasteClipboard"
  }

In later versions of VSC you can limit this key binding to a particular workspace in the when property, look at the key bind doc page.