title: How to monitor for swipe gesture globally in OS X
body: <p>I'd like to make an OSX application that runs in the background and performs some function when a swipe down with four fingers is detected on the trackpad. </p>
  
  <p>Seems easy enough. Apple's docs show almost exactly this <a href="http://developer.apple.com/library/mac/#DOCUMENTATION/Cocoa/Conceptual/EventOverview/MonitoringEvents/MonitoringEvents.html" rel="nofollow">here</a>. Their example monitors for mouse down events. As a simple test, I put the following in <code>applicationDidFinishLaunching:</code> in my <code>AppDelegate</code>.</p>
  
  <pre><code>void (^handler)(NSEvent *e) = ^(NSEvent *e) {
    NSLog(@"Left Mouse Down!");
  };
  
  [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask handler:handler];
  </code></pre>
  
  <p>This works as expected. However, changing <code>NSLeftMouseDownMask</code> to <code>NSEventMaskSwipe</code> does not work. What am I missing?</p>