In order to block ALL keyboard access, mouse access and keyboard shortcut events in one of my projects, I:
- Created a full screen transparent borderless window, in front of other windows, but invisible.
- Handle all keyboard and mouse events with simple
return;
the window itself. - Make the
window
modal[NSApp runModalForWindow:myWindow]
in order to block keyboard shortcuts. - Release
window
from touchpad's gesture events only.
But this guy made it look simple in a tiny app -MACIFIER:
How did he do it?