Re: enable Access for assistive devices programmatically
Re: enable Access for assistive devices programmatically
- Subject: Re: enable Access for assistive devices programmatically
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 13 Feb 2010 06:03:25 -0500
On Feb 13, 2010, at 2:53 AM, Manojkumar Yadav wrote:
>> So is there any way to do the same via program without asking for authentication and also application is not running as root use
Your main application does NOT have to run as root. The only thing that has to run as root is a small helper application inside your application package, and that is run only once to make the process trusted. After that, your application remains trusted on that computer even if the user quits and relaunches it, and even if the user turns off the computer and restarts -- and even though the application is NOT running as root.
So, every time the main application is launched, you call isProcecessTrusted(), which does NOT have to be run as root. If the result is false, run the helper application as root to get the user's authentication and make the process trusted, and the helper application then quits immediately. Every time after that the result returned by isProcessTrusted() will be true, so don't run the helper application. The helper application only has to be run the first time the main application is launched on that computer.
Your use of Quartz event taps shouldn't make a difference. The event taps keyboard functions should recognize that your application is trusted.
You really should be discussing this on the accessibility-dev mailing list, because that's where Apple's accessibility engineers lurk. They can give you better answers than I can.
--
Bill Cheeseman
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden