title: NSEvent modifier flags -- bug when both Shift and Caps-Lock are held down?
body: <p>I have an NSEvent Keyboard hook callback. I'm looking at the event's modifier flags to tell if the letter should be capitalized.</p>
  
  <p>When Caps-Lock is turned on and shift is held down, and you press a key... that key comes out as a capital letter but both <code>SHIFT</code> and <code>CAPS</code> flags return <code>FALSE</code>.</p>
  
  <pre><code>//For testing which flags are on.
  //Holding down Shift and Caps for some reason = FALSE FALSE...
  NSUInteger flags = [NSEvent modifierFlags] &amp; NSDeviceIndependentModifierFlagsMask;
  if( flags == NSShiftKeyMask ){
      NSLog(@"Shift - TRUE");
  } else {
      NSLog(@"Shift - FALSE");
  }
  
  if( flags == NSAlphaShiftKeyMask ){
      NSLog(@"CAPS - TRUE");
  } else {
      NSLog(@"CAPS - FALSE");
  }
  return newUserKeypress;
  </code></pre>
  
  <p>So,</p>
  
  <p>-Caps-Lock is ON (the light is on)</p>
  
  <p>-Shift is being held down</p>
  
  <p>-Tap [e] key</p>
  
  <p>-Output is "E"</p>
  
  <p>-But output of the above code is FALSE FALSE.</p>
  
  <p>Using either shift OR caps correctly reports the values. Why isn't having both of them on reporting correctly? And if both of them are off... why is the letter still being capitalized?</p>
  
  <p>If this is for some reason correct... how can I tell a normal keypress apart from a keypress with shift and caps held down? (they have the same FALSE-FALSE flags)</p>