I have entered the following code into my visual studio package. Followed by setting a break point on the handler. The break point is never hit. My intentions are to read the current line and input and take action if it contains a particular string.
...{ Events2 = Globals.Dte.Events as Events2; Events2.TextDocumentKeyPressEvents.AfterKeyPress += TextDocumentKeyPressEvents_AfterKeyPress; Events2.TextDocumentKeyPressEvents.BeforeKeyPress += TextDocumentKeyPressEvents_BeforeKeyPress; } void TextDocumentKeyPressEvents_BeforeKeyPress(string Keypress, TextSelection Selection, bool InStatementCompletion, ref bool CancelKeypress) { } void TextDocumentKeyPressEvents_AfterKeyPress(string Keypress, TextSelection Selection, bool InStatementCompletion) { }
Seems like a pretty straight forward code snippet. Any help would be greatly appreciated.