title: Enable access for assistive device programmatically
body: <p>I want to enable Access for assistive devices in System Preferences programmatically.     But Problem is that my application is not running as root user and i do not want my application to be as root user and also should not ask for any authentication in between.</p>
  
  <p>I want to tap all keyboard events globally. I am using CGEventTapCreate() for the same.In the documentation of  CGEventTapCreate() API it is mentioned that, Event taps receive key up and key down events if one of the following conditions is true:</p>
  
  <ol>
  <li>The current process is running as the root user.</li>
  <li>Access for assistive devices is enabled. In Mac OS X v10.4 &amp; later, you can enable this feature using System Preferences, Universal Access panel, Keyboard view.</li>
  </ol>
  
  <p>I tried manually by checking the Enable Access for assistive devices from System Preference and it gives me expected output.</p>
  
  <p>So is there any way to do the same via program without asking for authentication  and also application is not running as root user?</p>
  
  <p>Thanks,</p>
  
  <p>Dheeraj.</p>