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.
source share