title: Where can I find a list of key codes for use with Cocoa's NSEvent class?
body: <p>I'm looking for a comprehensive list of the available key codes that can be used with Cocoa's <code>NSEvent</code> class. The <code>NSEvent</code> class has a <code>keyCode</code> property, which is defined as <code>unsigned short</code>. The following code, when placed in an appropriate UI object, will echo the key codes as they are pressed:</p>
  
  <pre><code>- (void)keyDown:(NSEvent *)theEvent
  {
      NSLog(@"%d", [theEvent keyCode]);
  }
  </code></pre>
  
  <p>From this code, I can easily see which codes match certain keys, but I would like to find an official document somewhere that lists all of them. I expected Apple to have a header file somewhere that looked like this:</p>
  
  <pre><code>enum {
      ...
      NSKeyCodeLeftArrow = 123,
      NSKeyCodeRightArrow = 124,
      ...
  };
  </code></pre>
  
  <p>But if there is one, I have yet to find it.</p>