Search code examples
c#visual-studioidedeclarationshortcut

Visual Studio how to change GoToDeclaration shortcut (Ctrl+F12)


In Visual Studio, C#, we have many interfaces. And you want to see a function's implementation and the only way its by pressing Ctrl+F12=GoToDeclaration.

The other shortcuts Ctrl + Left Click or F12 will go to the function's definition in the interface. Which is not so used compared to the necessity to see the actual implementation and navigate code.

I highly navigate by clicking names. I know you also do. And the only way is by pressing two keys which is extremely slow especially because when inspecting you usually only use the mouse.

I want to change GoToDeclaration shortcut from Ctrl + F12 to Mouse middle button click (scroll click) and Visual Studio settings allows me only keyboard shortcuts.

Can't assign mouse shortcut


Solution

  • According to the comments:

    A simple workaround to use middle mouse button click (scroll click) instead of Ctrl + F12 for the GoToDeclaration shortcut is to use AutoHotKey program.

     ~MButton:: { Send {LButton} Send ^{F12} Return }