How can I write some C++ code to react on keystrokes (or any events) when someone is typing something in into the editor? I have seen plugins doing that (texType) - but I would like to know if someone can share some knowledge and or code fragments with me on how to make that happen?