How to handle a Ctrl+ keypress event in Excel VSTO?
I would like to be able to handle a Ctrl+x keypress event from within Excel (where x can be any defined key), such that the keypress will invoke a VSTO method on the worksheet which does some calculations and then sets a value in the currently selected cell. I haven't been able to find an event to handle this in开发者_运维百科 VSTO (there seem to be mouse events, and activate/deactivate events on a worksheet, but no keypress events).
I have toyed with using a VBA macro to handle the Ctrl+x keypress event, then getting VBA to call VSTO, but I don't want to go down this road if there is an easier way of doing it.
The question is what is the easiest or generally accepted method for doing this sort of thing?
精彩评论