Search code examples
c#visual-studiovisual-studio-addins

Visual Studio addin - override all existing commands?


I had an idea the other day to build a Visual Studio extension on GitHub that will teach people how to use hotkeys. I already have a dump of all hotkeys available (thanks to Mads Kristensen and his ShortcutExplorter project).

The way it will work (if possible) is to go through every command there is in Visual Studio, and override that command myself. Then, when you invoke it, it will run run the original command, but pop up with a semi-transparent dialog saying what hotkey to use instead.

For instance, if pressing the "Comment" button to comment out lines in Visual Studio, it will do the commenting, and pop up with a dialog saying "This action can be invoked via CTRL + K, C instead".

So. Is it possible for me to override existing commands in Visual Studio somehow or the context menus?


Solution

  • Here's the extension I ended up making.

    https://visualstudiogallery.msdn.microsoft.com/7c2c329e-331d-4b5c-b59a-7c4e7f8548de

    Here are the source codes for the solution.

    https://github.com/ffMathy/shortcut-commander