Vscode: Allow customization of mouse shortcuts

Created on 18 Feb 2016  Β·  204Comments  Β·  Source: microsoft/vscode

Some users would like to be able to customize not just pure keyboard shortcuts but also mouse + modifier ones. These are currently hard coded, for example alt+click to add a selection.

See https://github.com/Microsoft/vscode/issues/3091 for some more context.

editor-core feature-request keybindings

Most helpful comment

+1

I would like to do shift+cmd+leftMouseButton for Peek Definition, would be a perfect combination for me.

All 204 comments

+1

I would like to do shift+cmd+leftMouseButton for Peek Definition, would be a perfect combination for me.

+1

I've found an interesting performance implication resulting from the current defaults/lack of configurability. Consider the hard-coded modifier associated with the "peek definition" functionality. If a plugin must do some work to provide the definition, it's very likely VSCode will ask plugins for definition information even when the user has no intention of obtaining it. As I describe in https://github.com/Microsoft/vscode-go/issues/257#issuecomment-198993769:

For example, with the cursor resting still in the editor area, pressing ⌘ instantly invokes the GoDefinitionProvider, even when ⌘ is immediately used in a chord for some other command (e.g. copy, paste, opening the command palette, etc.).

This means calls to godef are happening when the user is pressing a very common key with no intention of obtaining contextual hover information.

When using vscode-go, this means significant extraneous energy usage which could be avoided almost entirely by providing modifier key settings for "peek definition". Not only would the feature be convenient and allow for better host OS GUI integration, but VSCode would be more CPU-efficient for common usages.

+1 – Atom, Sublime and jsbin.com (presumably others, too) all allow creation of multiple cursors with ⌘+click (on a Mac, at least). It'd be good to be forced to learn as few new shortcuts as possible when switching to a new editor.

I'm just completely avoiding using alt+click to add cursors until I can customize to make Windows and Linux consistent. Don't want to build muscle memory when it's going to change later.

@alexandrudima any thoughts on when you could get to this? It's blocking adding cursors via mouse on Linux. I can take a shot at it if you give a high level approach.

+1 I just discovered VS Code and I'm loving it, but as a long time Sublime Text user on Linux, I'm missing the ctrl + click ability. Would love to be able to customize mouse shortcuts.

From @ChristopherHaws in #6853

  • VSCode Version: 1.1.1
  • OS Version: Windows 10 Pro

In Visual Studio (full version), I tend to turn off the Ctrl+LeftMouseClick go to definition feature. I personally prefer to have Ctrl+LeftMouseClick select the entire word under my mouse cursor.

From what I can see, mouse events are not configurable at the moment, and they are also not possible to override with extensions (to the best of my knowledge). It would be really nice to have a mouse mapping configuration file. Sublime Text has this (although it is sort of a hidden feature that is not exposed through the UI). Just as an example, my sublime text mousemap file looks like this:

[
    {
        "button": "button1", "count": 1, "modifiers": ["ctrl"],
        "press_command": "drag_select",
        "press_args": {"by": "words"}
    }
]

+1 for customization.
I'd like using CTRL to multi-select instead of alt.

I would like to note, that adding cursors with the mouse is impossible on Linux, because alt+click is already used to move the window around (at least on KDE and XFCE), and therefore the alt+click behavior doesn't reach the code editor at all. So I would also suggest to change the default binding to something that doesn't conflict with key combinations of major window managers. Ctrl+Alt+click could work,

I would like to note, that adding cursors with the mouse is impossible on Linux, because alt+click is already used to move the window around (at least on KDE and XFCE), and therefore the alt+click behavior doesn't reach the code editor at all. So I would also suggest to change the default binding to something that doesn't conflict with key combinations of major window managers. Ctrl+Alt+click could work,

Please don't change the default. Using Alt to move Windows around is a bad default, e. g. Inkscape also has problem with this. The Windows key is much better suited for this, as it is more often used for "window manager" shortcuts, e. g. on Windows. Furthermore even the name makes more sense: "Windows key" -> "move windows around". It's also GNOME's default.

IIRC the choice of using Alt as the default for this was also a workaround, because the Windows key didn't act as a real "meta" key. Last time I checked I still couldn't map the Windows key to open the menu in XFCE and move windows around with it at the same time.

@jhasse Ok, I think that window manager stuff should all be done with the windows key modifier is a pretty good argument. But what do you mean with "Last time I checked I still couldn't map the Windows key to open the menu in XFCE and move windows around with it at the same time."? Do you want the windows key to be a modifier and a non-modifier at the same time?

But what do you mean with "Last time I checked I still couldn't map the Windows key to open the menu in XFCE and move windows around with it at the same time."? Do you want the windows key to be a modifier and a non-modifier at the same time?

I want to open the menu by pressing the Windows key (only) while still being able to bind key combinations with it and move windows around.

Let's not get to offtopic though. This issue is only about allowing customizations which - I assume - nobody objects to.

Ok, as long as we all agree here, that not being able to customize mouse shortcuts is bad, everything is fine. I might still say though, that at the moment I am not using VS-code anymore at all, and this issue is related to it.

There is a way to override alt+mouse for window modifiers using xfwm4-tweaks-settings.
screenshot_2016-10-21_09-30-43

But what @jhasse is point to is what should happen if you already have bound to open the xfce menu. If you have any keybinding for the Windows key alone Super L then once pressed, only that event is triggered and nothing else. Currently xfce defaults have nothing bound to Super L, and has ctrl+esc is bound to the window menu command xfce4-popup-whiskermenu.

I do still think that there should be a configurable way to address mouse bindings in vscode directly.

For now a workaround is to change the window manager's accessibility key from alt to super as in the image above.

@anchepiece I am not going to change my window manager settings, nor do I think that this can be barely seen as an appropriate workaround. Seeing this as an appropriate workaround is an insult to all people who got used to work with this setup for years. I won't cange my system shortcuts, just because of a stupid text editor get's in conflict with those keys, I rather avoid using the text editor.

@krux02 Completly agree. I tried it myself when it was suggested and couldn't get the hang of a new keybinding. It's would be much better to leave customization to the user.

This fixed my xenial.
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"

I am not sure when this feature was added, but I was able to make Ctrl+Left Click select the word under my cursor instead of going to definition.

[
    { "key": "ctrl+[mouse button]",            "command": "cursorWordLeft",
                                               "when": "editorTextFocus" },
]

@ChristopherHaws any idea where the [mouse button] definitions are declared? Or any chance you know what the binding is for a middle mouse click? I would love to try setting column selection to middle click + drag.

+1

+1 Please at least map 'multiple cursor' to an additional key map as a workaround until something gets sorted out. This was opened in Feb and most people probably just need a way to make multiple cursors in linux.

+1

Please add a reaction to this issue instead of posting "+1".

This was opened in Feb and most people probably just need a way to make multiple cursors in linux.

Multiple cursors already work fine with some DEs (like GNOME 3) on Linux. For others, see https://github.com/Microsoft/vscode/issues/3130#issuecomment-255382002 for a workaround.

@jhasse I am sorry to repeat myself, but that is a very bad workaround, that can not be seen as an ok-ish solution at all. It could only be seen as a temporary solution to show that in theory multiple cursors are technically possible, but not on something you could recommend anybody to to in practice. I am really sorry to react this way, and it might be annoying: Either you are honest and say do don't care enough because you don't think there are enough people who would benefit for the amount of work, or you fix it properly. But don't reference workarounds like that and pretend it is fixed when it is not. I am not paying for this product, so I am ok when you say you don't care, but I do care when you lie to yourself that this is not really a problem.

@jhasse last time I checked, adding a reaction doesn't make updates to the issue appear in the "participating" section of GitHub notifications. Posting a +1 comment served two purposes for me.

@krux02 You're right, a workaround is only a temporary solution. Just wanted to point out that saying "multiple cursors don't work in Linux" isn't correct. It's rather that multiple cursors don't work with some DEs.
If you globally grab the Alt key on Windows, adding multiple cursors with the mouse won't work there, too.

@sharwell What about subscribing to the issue in addition to adding a reaction?

@jhasse Subscribing puts the notification in the top category here. Replying puts it in the bottom category:

image

I haven't had any of the workarounds that I've researched work, and I really wanted them to. I'm on Linux Mint Sarah with Cinnamon. Honestly the quickest workaround is just go back to my atom setup. I need to code, not jack with desktop settings and cross my fingers.

I have found a horrible workaround for this issue (For Windows at least). You can install AutoHotKey and use the following script which will switch only Ctrl+Click and Alt+Click.

; Switches the Left-Control-Click and Alt-Control-Click shortcut for VS Code.
; Setting for allowing dynamic titles
SetTitleMatchMode, 2

#If WinActive(" - Visual Studio Code")
  ^LButton::Send !{Click}
  !LButton::Send ^{Click}
  Return
#If

I agree that Mouse Shortcuts should be built into VSCode, I rely on them daily as well. The solution I found doesn't work when clicking on words with a linked definition.

+1 for those who come from sublime / atom and would like to use cmd+click when adding multiple cursors or the cmd+drag for dragging cursors

+1 this would be awesome!!!

+1 miss cmd+click for new cursors from sublime - prefer not to use option + click

+1 so I can bind mouse buttons 3 and 4 to workbench.action.navigate*

@ChristopherHaws the [mouse button] does not seem to be working these days. What is the exact syntax of the command? https://github.com/Microsoft/vscode/issues/3130#issuecomment-263780725

@vferko It seems this workaround was removed at some point. I'm not sure when. =/

+1

The inability to rebind mouse+modifier controls is a deal-breaker for me, I can neither use nor recommend vscode to people who aren't VStudio users already. This is very unfortunate, as I really like the fast&solid feeling of vscode. Until I found this problem I was completely sold and willing to begin the process of switching over to vscode.

Remapping muscle memory for the most basic platform modifiers is too much to bear, I'll be staying with Atom until this is fixed. On a Mac: cmd-click adds to discontiguous selections; alt-drag on a selection copies that selection; otherwise alt-drag creates rectangular selections. Note: when creating rectangular selections the default is NOT to extend the selection from the previous insertion point, that capability should be placed behind a user setting flag.

Thanks for all your work to date, vscode is really nice! I'll be subscribing to this issue and returning at warp speed when it's successfully resolved.

+1, I'm using vscode in Arch Linux (Openbox), I can not use mouse navigation feature (back/forward) but this feature works fine in chrome and PCManFM file manager. I guess maybe button mapping is different in vscode. So, if I can remapping the button action, manually change it's behavior then I can fix the problem, it would be the best.

I'm using vscode in Arch Linux (Openbox), I can not use mouse navigation feature (back/forward) but this feature works fine in chrome and PCManFM file manager. I guess maybe button mapping is different in vscode. So, if I can remapping the button action, manually change it's behavior then it would be the best.

Best would be if it worked out of the box, don't you think?

please subscribe to this issue to help bump it up in the queue, thanks

:+1:

I also really would like the option to rebind mouse click events...this Option-Click for Multiple Cursors conflicts with all my other software...

Indeed if just binding the forward/back mouse buttons to workbench.action.navigate... is an easier sub-problem, it would be great to have that as a feature to start with

+1 - So used to control click selecting a word that this is becoming actively annoying for me.

I also would like to see that. I would like to replace "go to definition" with "go to type definition" on cmd+click

Another candidate is being able to customise the swipe gesture that we just introduced via https://github.com/Microsoft/vscode/issues/4803

+1 so I can bind mouse buttons 3 and 4 to workbench.action.navigate*

I don't think I will choose to use VSCode until this issue is resolved.

dunno if this is related, but i really want to disable ctrl+click on links...currently when you ctrl+click on a link in an html file, it opens the link in your standard browser...this "feature" is really a pain in the ass for me, i always want to copy a link with ctrl+c and when i'm doing it quick i already have ctrl pressed before clicking the link to select it and then my browser pops up and the tragedy starts :(

+1 running a Linux VM inside my mac, can't remap the mouse shortcuts to be more like those outside of the VM

+1 Essential feature

i need this to, go to change.org? :joy:

Change drag windows with Alt for Kubuntu (16.04):
Settings -> System Settings -> Window Management -> Window Behavior -> Window Actions -> Modifier Key -> change to "Meta"

using the cmd key to add multiple selections is working now for mac !!

thanks to all !!!

eh @ajoslin103 that wasn't actually the intent of this issue.

We should try to find a way to customize the interaction, instead of being given a hardcoded default.

For instance, cmd + click would be super useful to Peek as with most other editors.

Reducing mental tax, thats what we should strive for with keyboard shortcuts!

while I totally agree with you in spirit, this singular issue was the only thing keeping away from vsCode, lo these many moons -- and it took so long to find the problem, locked in an issue at the bottom of a chain (behind a door marked: beware of the leopard!)

I agree that a way to customize mouse+key interaction would be fabulous, I'm still frustrated by the selection extension behavior.

But at least I'm finally here, slowly picking my way through the forest of extensions and options trying to get back to the [nearly] 'thoughtless editing' I'd had with my prior editor.

Please forgive my tunnel vision

How this is going ?
When can we expect a released of this feature ?
I would love to change shortcut like ctrl+maj+mouse for block selection to alt+mouse !

+1, really want to get rid of the "Ctrl+Click => go to definition" binding.

I want to get rid of ctrl click go to definition as well, and instead use it to select the whole word. This is a feature I constantly used in vs and would use it everyday in vs code.

how is this not out yet....?

@lopugit this is an open source project, feel free to contribute to it.

As someone that contributes on a series of projects myself, it doesn't help at all when people post things like "why isn't this in the library?" "why doesn't this exist? It's needed!", etc.

Providing constructive feedback along with +1's for the root issue is what will help drive development.

Don't be entitled, the source code is open, pull your keyboard out and submit a PR if its that urgent.

For the record I'm all for this feature its just annoying to see people demand features for free software.

@oshalygin

sorry that I sounded entitled, It's now 7am and I've just been up all night working on my own projects, I didn't realise this was open source, I thought it was a microsoft project?

My comment only comes from the perspective of, jeez, ctrl+click not being an editable shortcut? Ya feel?

I am working on a few things to contribute to the open source community, I just wanted to add my thoughts to this feature here, every comment can be seen as good discourse.. kind of..

Idk, I'm super tired, peace ;)

@lopugit Well, since we are on GitHub here, yes, this is open source. πŸ˜…

@Tyriar I notice this is listed as backlogged, to your knowledge, is there a branch where anyone has begun working on adding "Mouse" bindings as customization options? It seems the conversation for this feature has been going on for a while, so I'm assuming its a fairly complex change.

No branch AFAIK. There has been a little movement on this; the editor.multiCursorModifier setting allows you to swap the multi-cursor and follow definition/link modifiers. There is no keybinding.json-like file for mouse bindings though which I imagine the solution to this will look like. I think this is mainly blocked on @alexandrudima freeing up who has many competing priorities.

I would like to use Mouse 4 + 5 (side buttons) for "navigate back" + "navigate forward". Already works in the browser and other IDEs. So please add mouse shortcuts =)

+1

Is everyone read this feature request???
+1

Seriously, please add support for mouse buttons in keyboard shortcuts!

It's coming on 2 years now! Why isn't this a feature yet! Please allow us to use mouse buttons in key binding

I wonder whether it would be easy to add a temporary change to allow column selection in Linux, such that Ctrl+Alt+click (just following the suggestion of krux02) also performed box/column selection in addition to Alt+click, which is blocked by the Linux Window managers? If mouse button customisation is added at some point, this temporary change could then be removed, but in the meantime it would relieve the biggest frustration I have had with using VS Code on Linux.

How long should we wait for this BASIC feature? Another year? It is a CORE BASIC COMMON feature like ENTER or DELETE?
Oh, my god whats going on... People will fly to Mars, and we fighting for mouse keyboard shortcuts. All other editors have this feature on board. But the new, cool kid on the block is behind...

I agree, this is a very basic feature, I dont understand whats going on...
We NEED this feature

You guys realize you're using a completely free tool that you can contribute towards right? I dont think anyone in the community is against a PR with this "basic feature" πŸ“„

@Thargarius @DoCode

If I remember correctly, this issue is caused by Electron, not so much VS
Codebase itself. So a fix would require patching the Electron source code
methinks =P

On Mon, Dec 4, 2017 at 10:49 AM Oleg Shalygin notifications@github.com
wrote:

You guys realize you're using a completely free tool that you can
contribute towards right? I dont think anyone in the community is against a
PR with this "basic feature" πŸ“„

@Thargarius https://github.com/thargarius @DoCode
https://github.com/docode

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/3130#issuecomment-349064344,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD2MVQ9h6MIa7CdtLZcXTrvt5XxYn1-9ks5s9D6ygaJpZM4HdSg8
.

I'm not a perfect Atom/Electron dev.
Anybody here, who can fix or start fixing this issue?

I think here is the Atom pendant.

+1

i'd like to press Mouse2Click (middle mouse button/scroll wheel) to navigate to declaration instead of Ctrl-Mouse1Click

i'd like to press Mouse2Click (middle mouse button/scroll wheel) to navigate to declaration instead of Ctrl-Mouse1Click

The ability to middle-click to open the definition of a method or variable would be nice, it's something I got used to in the GameMaker IDE.

It would be great to have the option to disable the middle mouse button double click paste function.

If VSCode had macro capabilities, this feature could probably be added in via a macro.

PLEASE go to issue #4490 and up-vote it (click on the thumbs-up button) and add your support!

https://github.com/Microsoft/vscode/issues/4490

I'd like to use the trackpoint on my thinkpad to scroll when pressing ctrl (like middle click emulation, ubnutu)

Is it possible to use shift+command and left button mouse click instead of command+left button mouse click or we need to ship this feature first?

I think this would be a nice feature, I would like to bind ctrl+mouse wheel to scroll forward and backward through time

I think this is what I'm looking for...

I really just want to be able to use the 'back' and 'foward' buttons on my mouse to equate to the keyboard shortcut actions 'Go Back' and 'Go Forward' respectively. It seems right now I cannot assign the mouse buttons to these. I'd even settle for a hardcoded solution so I can jump through my code!

Hey @nerael , totally agree. I've solved this issue by binding my mouse buttons to emit keyboard shortcuts that perform the 'Go Back' and 'Go Forward' actions in VSCode. It's easy to do this in Logitech's software, but there are ways to do this on Windows / OSX even if it is not supported by the device manufacturer.

Note that this is only a personal workaround and software level support would be ideal, but this can work in the meantime.

@jsonMartin

Thanks... this led me to a workaround. i approximated it this way
https://thecrumb.com/2015/06/03/xbindkeys/index.html

EDIT - this was also a very helpful tutorial about configuring xbindkeys
https://blog.hanschen.org/2009/10/13/mouse-shortcuts-with-xbindkeys/

My ~/.xbindkeysrc file is:

# VSCODE MOUSE BINDINGS FOR CODE JUMPING
# 'Go Back'
"xte 'keydown Control_L' 'keydown Alt_L' 'key minus' 'keyup Alt_L' 'keyup Control_L'" 
b:8
# 'Go Forward'
"xte 'keydown Control_L' 'keydown Alt_L' 'key equal' 'keyup Alt_L' 'keyup Control_L'" 
b:9

This is because my 'Go Forward' has been bound to ctrl + alt + equals. b:8 and b:9 are keycodes for my mouse buttons for forward and back!

EDIT - in case it wasn't clear, I'm using latest Ubuntu LTS as of this writing, not windows or OSX

I just want to be able to disable my mouse buttons in Visual Studio Code from doing anything as I use one of them for my push to talk key.

So why is there seemingly no answer or progress here? (I have not seen any comment from a collaborator, sorry if that's not true)

Is it an upstream issue of electron? Is it just not an important feature on the Roadmap?

+1

Hey @mhh1422 just a friendly reminder that if you are posting on a github issue, everybody subscribed will get an email.

If you have nothing constructive to add but want to increase awareness please use the reactions.

For everyone I spammed with this message, ❀️

@philiiiiiipp I like knowing how long this is taking though

+1

+1

@lopugit @Nemesis19 @DeadByElpy

Please add the +1 to the original issue at the top.

You can get notified without commenting by pressing the "Subscribe" button on the top right of this page.

This could be useful when you want to bind go back command with back button in mouse, this shortcut is widely used in web browser, and I believe that Visual Studio also has it.

Would be really nice to use "Alt + Scroll Up / Down" to increment / decrement numbers or loop through enums or something like this.

damn yes we need to able to use mouse buttons in the keybindings.. it would solve a lot of issues like being able to replacing the rubbish shortcuts like {
"key": "ctrl+pagedown",
"command": "workbench.action.nextEditor"
}
with ctrl+mousewheel down etc....

...done mousewheel tab switching.. so much better.

please get on this, it's about time already.

Hope this task is still on the table. I'd like to modify the SHIFT-ALT-LeftMouse "column select" combo into just ALT-LeftMouse...

I am switching from JetBrains products because of work and trying to adapt VSCode as much as possible to my previous workflow.

I used alt+leftclick on any highlighted text to get to the QuickFix menu. In the other editor it would be stuff like fix spell check typos, fix missing imports, simplify code, etc. All this actions are buried under the - now massive - right click menu.

Since I use a rollermouse because of disability this becomes harder than normal since now I have to do a wierd movement to reach the same actions.

Having the ability to customize such things would greatly improve my comfort.

I hope someone gets around to this.

Happy holidays!

@silentwarrior if you're on windows, as a workaround before it's implemented in vscode you can use something like autohotkey

As Reference finding is introduce to vscode in latest update. Most of the people habituated using it by ctrl + click. I tried same but its not supported.
It would be appreciated if mouse shortcut introduce soon.

It would be very useful to be able to mix mouse and keyboard keys natively in keybindings.json.
Also another very useful thing would be to be able to bind multiple combinations to a single command, the latter is fairly easy i guess.

@mortinger91 it is already possible to bind multiple keys to the same command, I don't know what you meant.

@mortinger91 it is already possible to bind multiple keys to the same command, I don't know what you meant.

Is it? I haven't done extensive research about it but I cannot seem to find any method like

{
"key": "key1","key2",
"command": "do something"
}

or similar syntax to use in settings.json, unless you mean some kind of macro or using an extension that i don't know about.

@mortinger91 you have to do it with multiple keys, like that:

[
   {
      "key": "combination1",
      "command": "command1"
   },
   {
      "key": "combination2",
      "command": "command1"
   }
]

@mortinger91 you have to do it with multiple keys, like that:

[
   {
      "key": "combination1",
      "command": "command1"
   },
   {
      "key": "combination2",
      "command": "command1"
   }
]

yes, thank you. I was already trying that but on a wrong command, confirmed working.
Still in for that mouse keys binding though

This issue (https://github.com/Microsoft/vscode/issues/5402 ) has already been referenced previously in the thread, but someone here asked if this issue was not moving because of an upstream issue with Electron, and as far as I can see, this issue is not related to that as Atom has an extension which allows for this behavior.

If this behavior could be replicated with a plugin in Atom, would it be possible in vscode?

Has anyone here considered porting the Atom extension to vscode?

I was trying to bind "Go back" to my mouse 3 button, ended up setting better touch tool to invoke the keyboard shortcut when I press the mouse button in VSCode. Could be a useful workaround in the meantime! πŸ‘

I realized scrolling is slow, looked for a setting to change it and I noticed "fast scroll sensitivity" and that "Alt" is actually a scrolling speed multiplier. I looked for ways to change "Alt" to "Super" in this particular instance but sadly could not find anything. :(

I was trying to bind "Go back" to my mouse 3 button, ended up setting better touch tool to invoke the keyboard shortcut when I press the mouse button in VSCode. Could be a useful workaround in the meantime! πŸ‘

How would I do this? I want to prevent mouse button 4 from invoking "Go Back" in Visual Studio Code but I want to still be able to use it elsewhere.

@Tyriar this has been opened for 3 years, how can we help to push this forward? :)

@george-cz I want to bind Go back to my mouse 3 button , How would I do this?

@stereokai according to a recent talk given by @egamma, the way is to upvote the issue here so that it bubbles to the top.

@foxx1337 do you mean react with πŸ‘ on the issue's comment?

its got like almost 500 thumbs up.. how much damn votes @egamma does it need..

why not just hire people who have clue about needs to be done to improve workflow.

Having looked into this a bit, here is what I believe the issues are:

  • The 'right' way to do this would be to pick up the events from chromium/electron. I don't believe they are exposed. (Note this is a long requested feature in Electron with them basically shrugging and passing pointing to the next layer down the tech stack).
  • The next way to do would be to write native npm packages that can pick up these events 'off the side' and post them through. This can be done on all 3 OSs (in very different ways) and fall into the category of 'unsavory hack'.
  • And the real showstopper: Extensions can't do this as the code needs to run 'in process' of VSCode's main app; and MS is unlikely to accept (imo) and patch that implements this (see 'unsavory' above).

So... Could it be done in an extension? In windows yes, but it would require a hacky DLL injection - at this point you are much better off installing some 3rd party OS specific utility that can map the extra mouse buttons to keystrokes.

So I could be mistaken on any/all of the above, but that's my guess as to the situation.

Oh my God. So a simple feature, from Windows side, but sooo complicated...

its been 3 years since the thread started, and vs code looks like practically didn't got any features/ergonomic changes during the whole time.

The vast majority of comments here are nonconstructive at best. Could the repo owners consider locking this issue?

@KevinMGranger Bad attitudes don't invalidate the necessity or relevance of this issue.

@stereokai I know, it’s one of my top wants for VS Code. But the discussion here isn’t really helping the feature get implemented. Locking doesn’t mean WONTFIX.

@KevinMGranger Unfortunately locking this issue will also prevent :+1: reactions to the first post, making the real number of people interested in this issue unknown (although, given the current number of reactions, maybe this is not needed, but I still prefer it to continue opened)..

If you're on Mint, you can just disable the Alt Click going to System Settings, Window, Behavior and then changing the "Special key to move and resize window". This way alt+click will work in vscode.

For the record, @ncesar's post that applies to anyone using Cinnamon (for example, Cinnamon on Fedora)

+1 , an alt-rightclick to copy relative paths would be awesome! (even better would be bindable ability to drag into current file to insert relpath, but that's another matter)

+1, an ctrl+right click to peek definition would be convenient for reading source code!

in windows i use ctrl+click for follow link and alt+click for cursor adding
but in linux i have to change it to alt but alt+click for follow links not working .

I would love to be able to map the mouse middle button to be "paste at location of mouse cursor" on my Mac. I'm used to this behavior from my linux boxen.

Towards the developers, can you pleas tag this issue as a bug or something similar. These tags make you feel like it is totally optional to solve this issue, but this issue is a major compatibility issues that renders important features of VSCode totally unusable for some platforms.

This was mentioned somewhere in the duplicate threads, I think. For the record, I'll say it here as well.

I stumbled upon this thread because I was wondering if I should purchase a mouse with more buttons just so I can bind stuff in Code. For example, mapping 3 side buttons to step over and step in/out while debugging. You're using the mouse to explore whatever is in the debug sidebar, so being able to advance execution with it would be very handy.

So besides rebinding left/right click, rebinding other mouse inputs would also be valuable.

+1. This functionality is really needed to be able to support ctrl+click for word selection. Ctrl+Click is not go to definition no matter how many people think it should be. This feature alone is singlehandedly the reason I cannot use VSCode even though I want to.

From a performance perspective I'd like to bind "middle click" to "Goto Definition". Webstorm has this by default and it makes navigating code so much easier.

When I mean performance, I mean developer performance

From a performance perspective I'd like to bind "middle click" to "Goto Definition". Webstorm has this by default and it makes navigating code so much easier.

As long as this is a setting, fine by me. On my system it would interfere with the paste mechanism.

I think at this point it is pretty pointless to go deeper into discussions. The developers made pretty clear through ignorance that they don't care about this problem.

@krux02 you could always contribute with code instead of snark. Or simply refrain from commenting.

Would you be motivated to work on FOSS projects if your users would behave like you? Keep it civil, those "imbeciles" on the other side of the issue tracker are people just like you and me, and they have feelings too.

@jrial, I work on free open source software and I contribute to other projects as well, you can verify that by visiting my github profile. And yes I have to deal with annoying users as well. This though isn't just snark. If you look at my past comments, I provided positive feedback in the past. But after more than 3 years of silence from the developers side and no improvement. They could at least apologize and explain why it is hard to fix this, but no, there is no reaction at all. My only conclusion is, the developers just don't care.

And no, I am also not contributing to fix this. Reason number 1 is, I am not using VSCode, because of problems like this.

I looked briefly to fixing it last year, but couldn't figure out how to build and launch VS Code locally from source so that I could debug and test it. I really only use VS Code for some small side projects so the time I have to put into a change like this is limited. I wouldn't be surprised to find one or more other people interested in this issue in the same boat.

We want to ctrl+click for select word instead of go to definition , but this capability is not exist !

Full mouse integration would be awesome. Any combination of Ctrl / Shift / Alt plus the most common mouse buttons (right/left click, scroll up/down, middle click/right/left, and the usual mouse button 4/5/ forward/back) would be amazing.

Nearing 4 years since opening of the ticket. Nothing on the horizon yet?

Has there been a regression regarding #71318 as back/forward doesn't seem to work on 1.39 on MacOS, can check with Linux as well.

They should put this as a new year resolution 2020! It's been almost 4 years and still no support for click keybinding.

Because of this, I do not think I can defend VSCODE or motivate people to use anymore :/

I really would like to use middle mouse button in a more proper way, to open up the manual, for example, but not to paste a text.

Any update when this feature will be GA'ed?

I really would like to use middle mouse button in a more proper way, to open up the manual, for example, but not to paste a text.

I wouldn't mind, as long as it remains optional and no standard shortcuts use the middle-mouse button anywhere one can paste text. This as to not alienate the *nix users to whom middle mouse equals "paste from secondary buffer", and who have committed this to muscle memory after years of use.

I think this issue consists of two, actually:

  1. Adding more customization about shortcuts, that is to say, for instance, allowing defining custom shortcuts for actions like word selection.
  2. Allowing "keyboard shortcuts" to be not just keyboard shortcuts but also mouse shortcuts, i.e. just to demonstrate, instead of allocating F5 to start debugging command, be able to allocate Ctrl+Shift+Middle Mouse Click for that.

If those two would be resolved, we'll solve this issue completely.
I want to take this issue, however:
I can handle myself the second problem. But for the first I need a list of more shortcuts you want. And because I think this is a separate issue, I will contribute just for the second problem right now. I think we should split this issue.

Like I compromised, I've implemented the second part - now in my branch you can associate mouse buttons to commands, including modifier keys and chords.

Before I submit a Pull Request, I want you to send me a list of common actions you want to be able to associate with mouse.

The process is actually simple: for every action, extract it from being embedded in the code to be a separate command, (if needed) add new contexts in order to mark when this command is enabled, and finally define a default shortcut for it, instead of the previous one, using the mouse.

I will wait around a week then submit a PR with the commands collected. I don't want to receive more actions after this week (I also need some time for myself), but it can take me some time to implement the ones already collected. Hopefully I'll end up soon - I see the hope in your eyes πŸ‘€

However, of course, you can mention more actions - as long as the PR will be accepted, it will be relatively easy to adjust new commands. And you always can contribute them yourselves - as always, contributions are welcomed!

Here's what I have for now, you're invited to add you own. Comment in this issue.

  • Go to definition (Ctrl+Click)
  • Select whole word (double click)

A note about "select whole word": I didn't check it (coming soon, hopefully), but although it seems to me pretty easy, even vital, to duplicate that as a command - i.e. to provide a command that will do side and can be allocated (for example) as requested here to Ctrl+Click, I think it's hard and maybe even impossible to extract that, i.e. to be able to allocate double-click for another purpose. That's because (again, I haven't verified it yet) this function is a part of the core editor, and (maybe, again) may require refactoring hundreds of lines of code. However I'll give it a try, and report you the results as long as they'll be available πŸŽ‰ πŸŽ‰ πŸŽ‰

Thanks a lot!

I'd add:

  • Peek definition (to add as Shift-Ctrl-Click, for example)
  • Peek references (Ctrl-Click already does the trick if cursor is on the variable definition)

@benoitmasson Is there a shortcut for "Peek definition"? I don't know one (using the mouse, of course).

  • middle button = "paste clipboard" or preferably "move cursor to that point and paste clipboard"
  • left button drag over text = "select and copy text to clipboard"

@benoitmasson After some research, I found that your so-called "peek references" shortcut is not real; the command "go to definition" does what you described when called on declaration line. If this is an issue, it's with the command - I'm not going to handle that.

It seems you don't understand: I'm not going to change the default keybindings. I think even Microsoft won't approve such PR. What I DO is extracting actions to commands instead of builtin behavior, so YOU can easily create your own mouse shortcuts with them,

OK, I'm not sure I get your point precisely but I'll try to clarify my comment. Probably not everything will be relevant to you, so pick what you want there:

  • Peek definition and Peek references are already VS code commands (see https://code.visualstudio.com/Docs/editor/editingevolved#_peek), so maybe you don't want to deal with them specifically (from what I understand, your PR will allow to switch from keyboard keybindings to mouse bindings, which is great).

  • More precisely, I'd love to be able to have a mouse binding to Go to definition AND Peek definition (both are commands, both are already possible with the mouse since version 1.43 but you have to choose one, I'd like to be able to do both with just a keyboard modifier + click)

  • Finally, the Peek references command already has a mouse binding when Ctrl-Clicking the definition (I don't need anything there, just to let you know)

And if this is all out of scope, don't bother, and sorry about the noise…

For peek references, I would think that since ctrl/cmd-"left click" is already bound to that (but hardcoded) then it should probably be changed such that ctrl/cmd-"left click" is a default binding with this new PR but can be changed.

I'd imagine this should be true of any existing mappings that currently have hardcoded mouse shortcuts.

I'd personally like to reprogram the other buttons on my mouse. Buttons like back, forward, horizontal scroll, and middle mouse button.

@AndreasBackx Middle button click - I've already implemented this functionality.
Back, forward - I don't know these buttons. Can you explain please?
Horizontal scroll - if you mean scrolling with mouse wheel, then you can't customize it with my implementation, and I don't mean to implement this, because unlike other functionalities, mouse wheel requires continuous communication between the keybindings service and the command to be executed, i.e. not just when finished scroll we should call the command, but also in the middle. Introducing this would, IMHO, require API changes to allow such communication (in fact, new command type which impacts new methods for registering and invoking it, even new protocols - not so nice), and I don't want to enter this topic. This is also the reason I didn't implement general mouse dragging - that is to say, my PR allows customizing dragging over editor text, or selection, but not general dragging like the one in the file explorer when you drag a file into a folder, because this dragging kind will require, again, a continuous communication in order to provide the visual feedback to the user (in my example, the the file name being dragged). However if there will be positive feedback from the community about those capabilities, I agree to reconsider my decision, but within a separate issue and discussion with a Microsoft employee (because of the API changes).

@ChayimFriedman2 The back and forward buttons are extra buttons found on some mice, usually under the thumb. These appear as extra buttons. Some mice have an extra scrollwheel there instead of or in addition to these buttons. Some have even more buttons.

Scrolling should not require anything different than normal mouse buttons, as every discrete click of the scrollwheel is seen by the OS as a button press. The scrollwheel just adds 2 extra buttons, which emit signals when the wheel is turned. E.g. under Linux, xev reports the following when scrolling down a single notch:

ButtonPress event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417460611, (103,113), root:(1285,747),
    state 0x10, button 5, same_screen YES

ButtonRelease event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417460611, (103,113), root:(1285,747),
    state 0x1010, button 5, same_screen YES

whereas scrolling up looks like this:

ButtonPress event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417468067, (103,113), root:(1285,747),
    state 0x10, button 4, same_screen YES

ButtonRelease event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417468067, (103,113), root:(1285,747),
    state 0x810, button 4, same_screen YES

Compare with a regular left mouse button click:

ButtonPress event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417598246, (135,115), root:(1317,749),
    state 0x10, button 1, same_screen YES

ButtonRelease event, serial 38, synthetic NO, window 0x9800001,
    root 0x255, subw 0x0, time 1417598297, (135,115), root:(1317,749),
    state 0x110, button 1, same_screen YES

@jrial Can you please tell me what are the MouseEvent.button codes for back and forward?

@jrial And if you can, you said there're more - please send me a list of name/code in the browser.

@jrial But I don't have plans to implement wheels. I also worry about the performance impacts of such feature - scrolling is a fast operation, in opposed to mouse clicking and key pressing. That means we'll need to trigger the command many times.

@jrial Can you please tell me what are the MouseEvent.button codes for back and forward?

I'm not a JS guy, but a quick search seems to indicate that you access wheels through WheelEvent. See https://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents

As for the back and forward buttons, see https://www.javascripture.com/MouseEvent and https://www.w3.org/TR/DOM-Level-3-Events/#dom-mouseevent-button

@jrial Can you please tell me what are the MouseEvent.button codes for back and forward?

Check this out, it mentions back and forward buttons: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button

Go To Implementation would be a great one to have a mouse shortcut for. https://code.visualstudio.com/Docs/editor/editingevolved#_go-to-implementation

Obviously the ideal scenario is if the mouse shortcuts can be configured to use any button and/or key combination. If that's not possible IMO it would be a shame if a shortcut required certain mouse buttons that aren't always available.

I think, and all from my colleges, that the default Visual Studio 20xx behavior (Ctrl+Click) would be a huge improvement: Select the underlying word under the cursor and when moved forward or backward the next words are also selected.

I would like to mention again: KEEP IT IN MIND: I AM NOT GOING TO CHANGE THE CURRENT BEHAVIOR.

Want different shortcuts from the default? Sure! Create you own keybinding extension (if you want
to to share it for others, otherwise just change your keybindinbgs.json or use the keybinding editor).

Using mouse shortcuts will become possible thanks to my work, but the default ones won't be changed. Developers don't like changes.

I think, given the title of the request, most folks following this just want the ability to modify the click behavior, and are providing examples of what the behavior in their setups will be given that ability.

I know that was what my posts/requests are expecting.

--
Alan Hoyle - [email protected] - alanhoyle.com


From: Chayim Refael Friedman notifications@github.com
Sent: Saturday, March 21, 2020 1:56:19 PM
To: microsoft/vscode vscode@noreply.github.com
Cc: Alan Hoyle alan@alanhoyle.com; Comment comment@noreply.github.com
Subject: Re: [microsoft/vscode] Allow customization of mouse shortcuts (#3130)

I would like to mention again: KEEP IT IN MIND: I AM NOT GOING TO CHANGE THE CURRENT BEHAVIOR.

Want different shortcuts from the default? Sure! Create you own keybinding extension (if you want
to to share it for others, otherwise just change your keybindinbgs.json or use the keybinding editor).

Using mouse shortcuts will become possible thanks to my work, but the default ones won't be changed. Developers don't like changes.

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode/issues/3130#issuecomment-602079576, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACGX4ZLQHZA2FMDCUYI3DTRIT5UHANCNFSM4B3VFA6A.

@alanhoyle What do you mean to say for me? (or you just want to mention)

I've faced a small problem - if anyone could help I'll be very happy.

In the beginning, I already saw that I can't bind commands to double left or right mouse click.

Why? because we can't differentiate a single click and a double click. See https://stackoverflow.com/questions/5497073/how-to-differentiate-single-click-event-and-double-click-event. The right button is the most problematic: it'll trigger context menu. But also the left can act on buttons etc..

Like suggested in the related SO answer (I thought about that myself too), you can use a timeout. But that's can't be customized to match the OS timeout of double-click.

I left with two options:

  • When dblclick event is fired for the right button, hide the context menu. That's too tricky and ugly approach (IMHO), and it does not handle cases like pressing a button with the left button - you can't cancel the action that was done by the click handler!
  • Using a timeout, like I thought. This approach has two problems:

    • The timeout must match the OS settings. This is solvable due to we're in Node.js and can communicate the OS (in opposed to browser-running js), but I don't know an Electron API that will bring us the requested timeout. Of course, we can either search npm for such module, or even I can write my own, but this module must be a native module (i.e. written in C++) and adding a native module to the build should be done only after discussion with a Microsoft member.

    • It will harm the UX as he'll have to wait a while for the context menu (not so much time, up to a second, but that's hardly harm productivity).

In the meantime (and probably it'll remain so), I'm just popping an error message when the user tries to use these shortcuts. This works greatly.

I want to open a discussion: in you opinion, when executing a selection shortcut (a shortcut uses that mouse selection), when the command (say "Copy") was executed, what should we do, and why?

  • Recover the previous selected (I don't think that's what the user expect to see: they select text, it's highlighted, and once they finished their selection - the selection jumps to another place...)
  • Remain with the text selected.
  • Move the cursor to the selection end.
  • Remain with the cursor at the selection begin (like #1 because of the fact that while selecting the cursor is at the end).

I'd like to hear you opinions πŸ˜ƒ

@ChayimFriedman2 I wouldn't make it do anything extra. Isn't it possible to define a list of commands? So one could first issue a copy command and then clear the selection after if that is desired.

I second the ability to make ctrl+click perform "Go To Implementation". I actually ended up in this thread because I wanted this option. Popping up a menu asking the user whether they want to view the import statement in that exact same file or the actual implementation has always been my no. 1 annoyance in VScode.

@kasvtv For now I'm using Ctrl+Alt+z to go to implementation, because I can do with one hand (if I'm not mistaken the default is Ctrl+F12), but I still would prefer a Ctrl+click or Ctrl+Alt+click approach.

Please, please, please, just provide a way to be able to use [ctrl][click] to be able to select the whole word, like Visual Studio does. I don't care how you do it, but please please please, just do it. If you have ever used it, then you know how easy it makes a programmer's life. Programmers like me love it so much because when adding a new function, we often start with a template and then change the details for our purposes. To that end, we end up changing words to other words multiple times in the function. Having [ctrl][click] makes that REALLY quick and easy: to fill the clipboard [ctrl][click], [ctrl]C ... then to change a word, it's just [ctrl][click], [ctrl]V. What makes it SO great is that you hold the [ctrl] key down the whole time. It is SO useful and natural that if you use it a few times, you quickly become dependent on it, and when it is taken away, your productivity goes way down.

Please.

just provide a way to be able to use [ctrl][click] to be able to select the whole word, like Visual Studio does.

Just double-click the word. That's muscle memory that'll serve you in far more situations, since it's more or less a cross-platform standardised way of selecting whole words. Apparently the Visual Studio team has chosen a somewhat weird convention and you now picked up an unconventional habit as a result. The answer is not to change everything to resemble the outlier; the answer is to embrace the standard that works _everywhere_.

Also: this is an issue tracker for an IDE. Written by and for software developers. I don't think you need to write a novella explaining why whole-word selection might be useful for "programmers like me". We know... ;)

Just double-click the word. That's muscle memory that'll serve you in far more situations, since it's more or less a cross-platform standardised way of selecting whole words. Apparently the Visual Studio team has chosen a somewhat weird convention and you now picked up an unconventional habit as a result. The answer is not to change everything to resemble the outlier; the answer is to embrace the standard that works _everywhere_.

I don't have this muscle memory, but think the power to change things like this is pretty important. It's hard for me to believe there's many people who've been programming for a while who haven't picked up one or two non-standard habits -- mine in particular is how sublime-style alt+drag for rectangular select. After over a year of using vscode, I've broken the muscle memory but still miss the functionality.

My point here isn't to say my issue is more important or anything like that (although it doesn't have a good "standard" alternative that works on a trackpad), but that a standardized form existing isn't really a good argument for not supporting something.

That said this is probably getting off topic so it's best if we not bang this drum much further...

Just double-click the word. That's muscle memory that'll serve you in far more situations, since it's more or less a cross-platform standardised way of selecting whole words.

🀨

Ctrl+Click is a gesture that is about selecting words instead of characters, not a single word. You can't ever do that much with a much slower double click.

It would already help having a nicer way to select single words, but that's only a part of the story. (Which I fear can not be adressed by only allowing to remap shortcuts, as gestures are more complex)

This is Β± how Visual Studio handle things:

  • Shift Down β‡’ Starts Keyboard Selection
  • Mouse Button 1 Down β‡’ Starts Mouse Selection / If Shift is down, sets the selection start at the previous location of the edit cursor.
  • Ctrl Down + Selection β‡’ Modifies selection behavior to word-by-word (Dynamic toggle for keyboard selection)
  • Alt Down + Selection β‡’ Modifies selection behavior to column/box (Cannot be disabled by releasing the key, but can be enabled dynamically for keyboard selection)

The gist of it is that Ctrl and Alt (and possibily other/future modifiers) act as selection behavior modifiers in a mostly consistent way, irrespective of the origin of the selection (mouse or keyboard).
There are obviously differences between mouse and keyboard selection modes in some corner cases, but that's not something you'd notice unless you're specifically looking for it.

But compare that to the way VS Code is (deeply) broken when it comes to consistency between keyboard and mouse selection:

  • Column selection will be Shift+Alt+Mouse Button 1 with the mouse, but becomes Shift+Ctrl+Alt+Arrow Keys with the keyboard. An extra key, just like that. πŸ€·β€β™‚οΈ
  • Word selection will be Shift+Ctrl+Arrow Keys with the keyboard, and… Oh, too bad, we forgot the mouse! 😐

It seems there are only special cases in VS Code's text selection implementation. I don't know how we ended up with that, but that's really bad.

I really wish selection modifier keys could be customized to fix this, but given the age of all related issues, I fear that's never going to happen… 😟

@GoldenCrystal VS Code implements the common paradigm of terminals and text areas, where a single-click drag is by glyph, double-click drag is by word, and as a bonus, triple-click drag is by line.

When in Rome, enjoy the local traditions and please note that non-Code VS is the weird one.

just provide a way to be able to use [ctrl][click] to be able to select the whole word, like Visual Studio does.

Just double-click the word. That's muscle memory that'll serve you in far more situations, since it's more or less a cross-platform standardised way of selecting whole words. Apparently the Visual Studio team has chosen a somewhat weird convention and you now picked up an unconventional habit as a result. The answer is not to change everything to resemble the outlier; the answer is to embrace the standard that works _everywhere_.

Also: this is an issue tracker for an IDE. Written by and for software developers. I don't think you need to write a novella explaining why whole-word selection might be useful for "programmers like me". We know... ;)

Just try double clicking on stuff all day ... you will find that there are many times the mouse or your finger didn't do the right thing and you single-clicked instead of double-clicked. Then make ctrl-click open a new window right there, and see how many times you have to close the window you inadvertently opened. Single-click is 100x easier and less error-prone.

I've been a software developer for 35 years. If it's really that hard to put an option in there to let us specify if we want this behavior or "peek definition", then I assert that the program is not designed very well. Why force us to do something that is so much less optimal and more error-prone? Just freaking do it and stop arguing about it. Microsoft did it for both Visual Studio and SQL Server Management Studio. We love it because it is SO natural and efficient.

I'm THIS close to saying "F VS Code" and writing my own or finding another editor that supports this. That is how valuable it is.

Perhaps you can't see why it's so valuable to us because maybe you don't see that it is an integral part of the activity we do all day every day. One of the most common things that many programmers do all day is select a word, copy it, and then replace another word with it somewhere else. With [ctrl][click] to select the word, it's REALLY efficient .. holding down the [ctrl] key, you just [click], c to copy the word and [click] v to replace the target word. Without [ctrl][click] to select the word, you have to double-click at least twice, once to select the source word, and then every time to select the target word. Double-clicking is a very error-prone operation. Is it really that hard to put in a configuration setting to do that instead of "peek definition". You already have a setting to turn it off. How hard could it be?

Is there at least a way to just simply disable the ctrl-click action, so that it doesn't jump you to the definition?

I second the ability to make ctrl+click perform "Go To Implementation". I actually ended up in this thread because I wanted this option. Popping up a menu asking the user whether they want to view the import statement in that exact same file or the actual implementation has always been my no. 1 annoyance in VScode.

This! IMO "go to implementation" is much more natural when done as a point and click, being logical extension of "go to definition", e.g. the way it works in ReSharper - CTRL+ALT+LMB

Is there still not a way to do ctrl+click in visual studio??

@thedrean you mean visual studio code (VS code) right? Visual studio is completely different IDE https://visualstudio.microsoft.com

Is there still not a way to do ctrl+click in visual studio??

Not yet

+1 This needs to happen yesterday. I searched google for how to remove the default Ctrl+Click functionality because it's the most frustrating thing about VSCode, very disappointed. As @CCurl pointed out, it's something that developers do not just daily but minutely, and the Go To Definition default is just extremely annoying. I just want to select a bit of text quickly, is that too much to ask in an IDE?!

Why would Microsoft effectively train users to one set of keyboard shortcuts (visual studio) and then seemingly as a joke change those bindings in VSCode? Seems like an insane user experience department to me.

Another common one is Ctrl+K+D to format things - please give us an option to select a keyboard binding "template" which closely matches Visual Studio.

Another one! Ctrl+. is so close to Ctrl+, that you often mistype it and the settings window opens. Annoying.

It's important to remember that there are many users of VSCode who did not previously use Visual Studio. While I can understand users who did come from there would expect the same keyboard and mouse bindings, it would be shortsighted to limit the functionality to simply mimic the Visual Studio bindings.

Allowing customization is the key. I imagine there could be a variety of extensions once customization is allowed: one to mimic the Visual Studio mouse bindings, one could mimic the X/Unix/Linux generic bindings ("middle click paste" e.g.), etc. There are already similar extensions that do the same thing with the keyboard bindings to mimic other editors (Sublime, Emacs, VIM, etc), and those could be extended with mouse bindings as well.

Not only "never used VS", but also "used \".
I.e. Ctrl+Click = peek definition is (was) also common for Borland IDE's.

But on top of that, I find myself waving mouse to close current open tab, often. Muscle memory…

Every now and then, I would try the VS Code after seeing some good improvements in the change log. But the first thing that hit me is I still customize Alt + Click as peek definition. Then I am back to IntelliJ. I think many others would be feeling the same way about not being able to remap the mouse click.

The Ctrl + Click to select whole word (and drag to keep selecting word-by-word) is also a wide-reaching accessibility feature.

It is not only easier and more comfortable, but also healthier (or less damaging).

So I found a (maybe imperfect, but still) work-around that lets me select/copy a word with a single keypress and replace another word with the last thing that was copied. It uses the VIM extension, and custom normal-mode key bindings.

Now I can click anywhere in a word and press [ to copy the entire word. Then I can click anywhere in another word and press ] to replace that word with the word I just copied.

It's not perfect, and I am still learning the VIM way of editing files, but I THINK I am going to like it. VIM is very powerful.

image

Another work-around to the click problem ... install the "macros" extension from "geddski". Then put this in your settings.json file:

"macros": {
    "copyWord": [
        "cursorWordEndRight",
        "cursorWordStartLeft",
        "cursorWordEndRightSelect",
        "editor.action.clipboardCopyAction"
    ],
    "replaceWord": [
        "cursorWordEndRight",
        "cursorWordStartLeft",
        "cursorWordEndRightSelect",
        "editor.action.clipboardPasteAction"
    ]
}

Then bind them to whatever keys you want in your keybindings.json:

{
    "key": "F9",
    "command": "macros.copyWord",
    "when": "editorTextFocus"
},
{
    "key": "F10",
    "command": "macros.replaceWord",
    "when": "editorTextFocus"
}

Now I can click, F9, click, F10. Not exactly the same as click, C, click, V, but pretty damn close.

Support! Even Visual Studio has the ability to adjust font size via "ctrl + mouse scroll".

VS Code can do mouse zoom just as well, I dunno why did you mention THAT without checking.

+1

Any chance this issue will ever get looked at? It is now 4 years old and has over 800 upvotes... It is the #1 issue preventing me from switching to VS Code. Specifically I want to be able to disable/remap Ctrl+Click from 'Go To Definition' to 'Select word' like Visual Studio. While I get the request for full blown mouse config, I would be happy with a simple boolean config for this setting as a temporary workaround.

Issue https://github.com/microsoft/vscode/issues/71817#issuecomment-482754429 points here so I'd like to ask: Any way to allow middle mouse clicks (PASTE) to pass-through the terminal?

I'm on MasOS Catalina with a bash terminal, which behaves correctly in standalone mode, but ignores/doesn't-receive middle mouse clicks when embedded in VSCode.

Terminal > Integrated: Middle Click Behaviour
Controls how terminal reacts to middle click.
(dropdown values: all the same as Right Click Behaviour, as long as it includes "paste")

I just want middle click paste, it's common enough on terminals (e.g. Mac, various Linux) that it should be offered as an option in VS Code

One more vote from me to be able to paste with middle click and auto copy when select a text in the terminal

@KrisPetkov auto copy on select is already an option
screenshot_2020-10-12_at_14 12 58

also note in the settings above that you can enable _right-click_ paste, which while it isn't middle-click paste, might be something you could get by using in the meantime

Any progress?

ctrl+wheel -> navigate back and forward

I'd like to implement the middle mouse button to go to definition instead of having to press ctrl + click or F12.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  Β·  3Comments

curtw picture curtw  Β·  3Comments

VitorLuizC picture VitorLuizC  Β·  3Comments

borekb picture borekb  Β·  3Comments

chrisdias picture chrisdias  Β·  3Comments