0
votes

I find two method to handle global events on Mac OS:

  1. NSEvent.addGlobalMonitorForEvents only get a copy of origin event, can monitor, but not change or prevent.
  2. Use InstallEventHandler like the answer at How to Capture / Post system-wide Keyboard / Mouse events under Mac OS X? question. But only GetEventMonitorTarget() work, so I only monitor events。

So, How to prevent/change the system-wide events ? The KeyboardCleanTool app (http://blog.boastr.net/?p=2452) can do like that, so I think it is possible.

1

1 Answers

1
votes

You can use Quartz Event Taps for that. In order to monitor/change/block keyboard events, your process will need to be trusted for Accessibility access.