views:

13

answers:

1

I am trying to detect a copy event in the text view and I have been researching the best way to do this. Is it to possibly hook into the StandardCommand Copy event somehow and detect it that way? Or is it possible to use the KeyProcessor(and simply detect Ctrl+C keypresses)?

My extension is currently implementing the IWpfTextViewCreationListener; is there a way to somehow get access to the KeyProcessor or StandardCommand from the IWpfTextView that the listener is passing to me? If so, can you post a code sample that demonstrates this?

Thanks! Nick

+1  A: 

You can listen for the Copy command (listening for ctrl-c won't work, as the shell turns it into a command before the editor sees the keypress event).

Take a look at the command filter template I wrote. You'll need to make sure you have references to the assemblies listed in this file.

Noah Richards
Thanks once again Noah!
Nick U