Event Capture on Mac OS X

Does anyone know how to catch events on Mac OS X? My problem is that I need to intercept, for example, MOUSEKEYDOWN or possibly KEYSTROKE before the event arrives in any application. My goal is to block the event or change the data that it may contain. I read something about the kEvent class, but I could not find any sample to figure out how to start programming with it.

+4
source share
2 answers

Try short-term taps. You can learn how they work with Event Taps Testbench or read the documentation .

+1
source

As far as I know, you can use the Carbon API to log events and change them . Changing an event is not possible if you are using Cocoa, i.e. An NSEvent class that can only be observed. I used this tutorial to get started with the Carbon API. It was very difficult for me to find any manuals not using Cocoa, so I hope this helps.

0
source

All Articles