10

Is it possible to remove all Key-Shortcuts from Visual Studio, so I can assign them from scratch? I don't mean to reset them to their default value, but to nothing.

Databyte
  • 1,420
  • 1
  • 15
  • 24
  • 1
    FYI this tool illustrates the extent of the problem: https://visualstudiogallery.msdn.microsoft.com/6ce3b73c-2284-4b95-b61d-6de74aa8dfe6 - if you export all predefined shortcuts & sort by keyboard combination, you see that for example, there are 6 pre-assigned meanings to "Alt+1". Being able to wipe out all that stuff so that new assignments don't have such a high percentage chance of colliding with existing ones would be useful. – fastmultiplication Jan 15 '16 at 22:17
  • See also https://stackoverflow.com/questions/39043624/programmatically-reset-visualstudio-shortcuts – Sergey Vlasov Aug 28 '19 at 04:57
  • How come Visual Studio is so outdated? I'm in shock to have to struggle for such features. Do they even take a look at modern IDEs? – J. Bailleul Mar 10 '21 at 10:56

1 Answers1

10

I wanted to do the same with my installation of Visual Studio - to remove all shortcuts and assign my own, from scratch. I managed to achieve this with a hacky AutoHotKey script.

If you select a command that is bound to a shortcut, within the 'Keyboard' section of the Visual Studio Options dialog, the 'Remove' button should activate. Notice that the 'R' is underlined (which, if isn't, hold the Alt key down).

VS Keyboard Options

On Windows, this generally means that the button can be activated by pressing Alt, and the underlined character.

Removing all shortcuts is then a matter of repeatedly un-binding the selected command with Alt + R and selecting the next command (), which I automated using the following script:

#z::              ; Binds to Win + Z.
Loop, 3500        ; Loops 3500 times.
{
    Send, {Down}  ; Sends the down keystroke.
    Send, !r      ; Sends the Alt + R keystroke.
    Sleep, 30     ; Delays for 30ms.
}
Return

Adjust the number of repetitions (3500), and the hotkey to invoke the script (#z which means Win + Z) as necessary. Run the script, select the first command in the list, press (in this case) Win + Z, and wait for it to complete.

Note that commands don't always have a single key-binding, and therefore you might have to run the script a couple of times, or better yet, send the Alt + R keystroke multiple times a single repetition.

The script will attempt to remove un-assigned shortcuts too, upon which Windows will play a 'beeping' sound and therefore make sure to mute Windows before running the script.

ravindUwU
  • 657
  • 11
  • 26
  • 1
    This is very much a hack-ish solution, but running it multiple times seems to remove all shortcuts. Thanks! (isn't there some kind of configuration file where one can go and just remove all shortcuts?) -- Edit: On the German language version of Visual Studio, the hotkey is "E" (as in "Entfernen"), so "!r" has to be replaced with "!e". – Thomas Perl Sep 22 '22 at 11:31