title: How to catch Command+W key action in OS X?
body: <p>I subclassed NSWindows and implemented the <strong>keyDown:</strong> and <strong>keyUp:</strong> method like this:</p>
  
  <pre><code>- (void)keyDown:(NSEvent*)event
  {
      NSLog(@"Down: '%@'", [event characters]);
      [super keyDown:event];
  }
  
  - (void)keyUp:(NSEvent*)event
  {
      NSLog(@"Up: '%@'", [event characters]);
      [super keyUp:event];
  }
  </code></pre>
  
  <p>If I pressed "W" key, it prints both my "Down" and "Up" correctly. But If I pressed Command+W combination, It prints ONLY the "Down" message, and windows' close action was not triggered. How should I do?</p>