title: Map NSEvent keyCode to virtual key code
body: <p><a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html#//apple_ref/occ/instm/NSEvent/keyCode" rel="noreferrer">NSEvent keyCode</a> gives a keyboard scan code, which is a hardware specific code representing the physical key. I want to convert the scan code to a virtual key code, which is the logical key based on the users keyboard layout (QWERTY, AZERTY, etc).</p>
  
  <p>In Windows I can do this via <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646306%28v=vs.85%29.aspx" rel="noreferrer">MapVirtualKey</a>. What is the OS X equivalent?</p>