Vscode: Allow middle mouse button to be bound in keyboard shortcuts

Created on 16 Feb 2018  路  18Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.20.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Change keybinding for a shortcut
  2. Click middle mouse button when prompted for a key combination

(feature request) Not technically a key, but it could be useful if bound like one. Example: middle mouse click to go to definition.

feature-request keybindings

Most helpful comment

This would also be highly useful on linux for overriding middle mouse click from paste -> anything else (...even with editor.selectionClipboard is false).

All 18 comments

This would also be highly useful on linux for overriding middle mouse click from paste -> anything else (...even with editor.selectionClipboard is false).

Being able to define all mouse clicks would be nice. Especially for something like https://github.com/James-Yu/LaTeX-Workshop/issues/716

This would also be highly useful on linux for overriding middle mouse click from paste -> anything else (...even with editor.selectionClipboard is false).

My understanding is that in Linux, this middle-click functionality is coded into Xorg, so it would not be trivial for VSCode to have this functionality.

My issue is that VSCode currently maps multi-line select to the middle mouse button which behaves very weirdly when I actually try to use it.

In Linux Mint both Chrome and Firefox are able to bind middle click to page scroll.

Is there any extension available right now to use middle click for jumping to the definition? I'm very used to this from pycharm etc..

@poodle-chowder , I think this is a duplicate of https://github.com/microsoft/vscode/issues/3130 ?

I really need this functionality too, I'm migrating from Android Studio to VSCode, and I go to defition with middle mouse click, and VSCOde don't have plugins to this or duplicate with ctrl + D.

Please consider to implement this functionality.

This prevents me from using VS Code :( I so much get used to navigate though the code by just clicking on the class names...

When will this be added already!?!... it opens up at number of much more easier shortcuts especially with mmb+modifier key.... like commonly used ones like ctrl+shiftf+f12 ...I mean I use 'find all references' all the time, would be so much better bound to mmb+modifier,

For those of you who are looking for a short term fix for this, I've created an AutoHotkey script which provides middle-click Go To Definition behaviour:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#IfWinActive ahk_exe Code.exe
~MButton::
MouseGetPos, xpos, ypos

if (ypos >= 87) {
    SendInput,{Click}{F12}
}

return

Copy the above contents into a file named vscode-f12-go-to-definition.ahk and run it. You'll see a green H icon in your systray which shows it's running.

Tip: you can a use a tool like BetterTouchTool for mouse / touchpad / touchbar on mac:

better touch tool screenshot with two assigned mouse shortcuts to vscode for navigation controls

simplicity for most commun things is not part of the program really
uncomment you search you don't find comment this is mad shortcut hey take your pils

shortcut are so messy that ok bye. middle mouse button to select a line is not so much to ask. 3 tonnes of messy shortcuts

do you guys not have a keyboard?

@chipnertkj In all other IDEs I can click on a class name with MMB and navigate to the reference WITHOUT touching a keyboard - using ONE hand only. But this is how it looks in VS Code:

image

You can just navigate to it without your hand ever leaving the keyboard. Just think about how much time that can save you. I get that it'd be a useful feature for people who aren't used to keyboard navigation and I agree that it indeed should be a feature, but since it doesn't seem like we're getting it anytime soon - why don't you try it out?

You can just navigate to it without your hand ever leaving the keyboard. Just think about how much time that can save you. I get that it'd be a useful feature for people who aren't used to keyboard navigation and I agree that it indeed should be a feature, but since it doesn't seem like we're getting it anytime soon - why don't you try it out?

But a lot of us are going through the code with the mouse because we quickly navigate between definition trees. We can't not keep our hands on the keyboard if we didn't have it there to begin with. You're missing the point

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisdias picture chrisdias  路  3Comments

villiv picture villiv  路  3Comments

ryan-wong picture ryan-wong  路  3Comments

lukehoban picture lukehoban  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments