I’d like to disable the keyboard in OS X, programmatically, as my cat tends to walk on it & wreak havoc during the progress. I will use the mouse to enable it again by clicking a small icon in the menu bar.
This can be done by unloading the kext responsable for keyboard input, but that requires root privileges.
Any ideas on how to archive the same results without root?
It could be done with a Quartz event tap (see
CGEventTapCreate). This would require you to go into the Universal Access preference panel and check “Enable access for assistive devices”, but not root privilege.