Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove all Key Shortcuts from Visual Studio

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.

like image 546
Databyte Avatar asked Jun 05 '14 10:06

Databyte


1 Answers

I wanted to do the exact same thing with my installation of Visual Studio - to remove all shortcuts and assign my own. I managed to remove all shortcuts 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, of which you'll notice that the 'R' is underlined (which, if isn't, hold the Alt key down).

VS Keyboard Options

In Windows, this generally means that the button can be 'pressed' using the Alt accelerator key along with the respective character (in this case, 'R'). Sure enough, the Alt + R shortcut worked, and unassigned the corresponding (in this case, Build.BuildSolution) shortcut.

So, removing all shortcuts is a matter of un-binding the selected command with Alt + R and selecting the next command () repetitively. Which I automated using the following script,

#z::              ; Binds to Win + Z (which wasn't assigned to anything).
Loop, 3500        ; Loops 3500 times.
{
    Send, {Down}  ; Sends the down keystroke.
    Send, !r      ; Sends the Alt + R keystroke.
    Sleep, 30     ; Introduces a 30ms delay.
}
Return

Adjust the number of repetitions (3500), and the key binding to invoke the script (#z which means Win + Z) according to your requirement. 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.

like image 86
ravindUwU Avatar answered Oct 04 '22 05:10

ravindUwU