Question

I am trying to create simple extensions for myself and assign it an easy shortcut Since I use my extension mostly in debug mode "F9" will be a handy keyboard shortcut but this shortcut is already assigned to "Debug.ToggleBreakpoint"

I am using below code but its not overwriting default keyboard shortcut

<KeyBinding guid="guidLWConfigCmdSet" id="cmdidAHSLWConfig" editor="guidVSStd97" key1="0x78" />

Is there any way to override the default shortcut for my extension using VSCT file or any code in the extension?

Was it helpful?

Solution

There isn't an easy way to do this -- users don't like it when extensions hijack keys, and we don't want to make it easy for extensions to do it. You can use EnvDTE.Command.Bindings if you want to change bindings programmatically; the best approach might be to define your own command, and then rebind F9 to it. You might want to look at what VsVim does for keybindings, since it also needs to let users customize what keys do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top