vsix - How can you tell if a Visual Studio command was triggered by keyboard or menu? -


is possible know if visual studio command triggered keyboard or menu? i'd write plugin monitored vs commands , suggested keyboard shortcuts commands chosen menu.

it not possible determine command itself, how triggered. neither can information commandevent. design, because commands can bound arbitrary number of triggers of kind (including explicit invocation in code).

what can do, however, register listener on commandbarbutton.onclick , commandbarcombobox.onchange in tree dte.commandbars.controls. whenever 1 of above events occurs, capture next commandevent. command triggered respective commandbarcontrol.

i guess sufficient scenario describe. note, however, cannot conclude other commands triggered shortcut, since commands can triggered implicitly (through other commands). can approximate checking whether or not key pressed, when command occurs, rather fragile approach... if knows better approach here, adds welcome!


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -