2

Is it possible to have multiple commands on same Keyboard Shortcut in Visual studio?

like clicking F7 caused two different commands at the same time, instead of only 1 command.

T.Todua
  • 53,146
  • 19
  • 236
  • 237

1 Answers1

3

You can create a Visual Commander command that calls multiple VS commands and assign a shortcut to it, like this:

public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
{
    DTE.ExecuteCommand("Edit.Copy");
    DTE.ExecuteCommand("Edit.Paste");
}
Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • How can I add this command shortcut: Ctrl + k, Ctrl + k, Ctrl + m, Ctrl + l, Ctrl + m, Ctrl + l, Ctrl + k, Ctrl + n, Ctrl + k, Ctrl + k –  Jul 31 '19 at 06:18
  • @Mehdi You should look for command names assigned to these shortcuts. See https://stackoverflow.com/questions/13764306/visual-studio-find-out-what-command-is-assigned-to-an-hotkey – Sergey Vlasov Jul 31 '19 at 06:36