Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Register new Commands during Runtime in VS & assign Keyboard Shortcut to them?

$
0
0

Good afternoon,

I have a VS Package with several custom toolwindows & inside one of these ToolWindow types we host MEF loaded/managed, dynamic 'plug-ins' for the main functionality and some of these would like to e.g. handle the standard CTRL+S/CTRL+F etc shortcut.. but only when the toolwindow is active + also provide other, custom functionality with more non-standard kb-shortcuts.

What's the best way to achieve this inside VS particularly considering that by default ctrl+f brings up the normal VS find dialog?

A quick idea was to provide custom commands and bind keyboard shortcuts to them for the custom functionality & and shortcuts, but what about the more standard ones like ctrl+s (read: if they were e.g. in a standard c# code editor window ctrl+s should obviously trigger the default VS file saving funtionality, but when of our own toolwindows is open, another logic should run. Is it even possible to register new commands during runtime?

Or is there an easier way to do this without command (re)routing?

Thanks,

-Jörg


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>