Visual Studio Code extension - mouse middle click go to definition

Viewed 394
1 Answers

Author Credit: https://github.com/danielsamuels

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.

Related