title: OS X count pressed keys without accessibility access
body: <p>I found that upwork.app can count pressed keys without accessibility access but I can not understand how it is done.</p>
  
  <p>I read a lot of themes like this one:
  <a href="https://stackoverflow.com/questions/4752427/osx-detect-system-wide-keydown-events">OSX: Detect system-wide keyDown events?</a></p>
  
  <p>In all themes are saying that process should be trusted "Enable access for assistive devices" and I can not find how upwork.app can track keys without this.</p>
  
  <p>This is official documentation for tracking events:<br>
  <a href="https://developer.apple.com/reference/appkit/nsevent/1535472-addglobalmonitorforeventsmatchin" rel="nofollow noreferrer">https://developer.apple.com/reference/appkit/nsevent/1535472-addglobalmonitorforeventsmatchin</a></p>
  
  <blockquote>
    <p>Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted).</p>
  </blockquote>
  
  <p>In apple mail list is saying same:<br>
  <a href="http://lists.apple.com/archives/carbon-dev/2010/Feb/msg00043.html" rel="nofollow noreferrer">http://lists.apple.com/archives/carbon-dev/2010/Feb/msg00043.html</a></p>
  
  <p>I think that upwork.app use some hacks.</p>
  
  <p>How I can count pressed keys without accessibility access?</p>