title: Objective-C: NSStatusBar right and left click
body: <p>how to detect left or right click on statusbar icon, and than make some action, depending on which mouse button (trackpad) was clicked?</p>
  
  <p>I use:</p>
  
  <pre><code>  _statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
    [_statusItem setMenu:menu];
    [_statusItem setHighlightMode:YES];
  </code></pre>
  
  <p>To generate statusBar icon</p>