How to hook all keyboard and mouse input for a given window ?
Can I write a macro which will handle Ctrl-click or Shift-click on the document window and then will do something with the clicked word?
You can find some events by going to the Macros menu, Customize, check Runs at Events, and then click the Events button. But that is all we have. For mouse clicks, you will need to write a plug-in.