I want to enable Access programmatic access for assistive devices in the system settings. But the problem is that my application does not work as a root user, and I do not want my application to be a root user, and also does not have to request any authentication between them.
I want to use all keyboard events around the world. I am using CGEventTapCreate () for the same. The CGEventTapCreate () API documentation mentions that Event taps receive key and key down events if one of the following conditions is true:
- The current process runs as root.
- Access to assistive devices enabled. In Mac OS X version 10.4 and later, you can enable this feature using System Preferences, Universal Access panel, Keyboard View.
I tried it manually by installing Enable Access for assistive devices from System Preference, and this gives me the expected result.
So, is there a way to do the same through a program without asking for authentication, and also the application does not work as root?
Thanks,
Dheeraj.
scripting objective-c accessibility cocoa accessibility-api
Dheeraj
source share