title: Detecting NSKeyUp of the Shift key
body: <p>I am using this to detect keystrokes on my app...</p>
  
  <pre><code>[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown
                                      handler:^NSEvent * (NSEvent * theEvent)
  </code></pre>
  
  <p>OK I can use <code>theEvent</code> to know what characters were typed and know if a shift was pressed using this:</p>
  
  <pre><code>NSString *typedKey = theEvent.charactersIgnoringModifiers;
  BOOL shiftDetected = [theEvent modifierFlags] &amp; NSShiftKeyMask;
  </code></pre>
  
  <p>My App has an interface displayed with some buttons and I am allowing the keyboard to be used instead of clicking on the buttons. This interface has 3 buttons in particular that has a second function. </p>
  
  <p>For example: the first button has 2 functions, <code>A</code> and <code>B</code> but just the <code>A</code> label is displayed on that button. Lets say I specify that the letter <code>Q</code> is the keyboard shortcut for that button. If the user presses <code>Q</code> function <code>A</code> is executed. If the user presses <code>Shift Q</code> then function <code>B</code> is executed.</p>
  
  <p>But this is the problem. I need to detect all presses or releases of the <code>Shift</code>, because the moment the user presses <code>Shift</code> I have to change the label of that button from <code>A</code> to <code>B</code>, so the user knows that now that button will lead to the execution of function <code>B</code> instead of <code>A</code>.  Like a keyboard that will change from lowercase to uppercase while <code>Shift</code> is being hold and change back to lowercase the moment <code>Shift</code> is released.</p>
  
  <p>How do I do that?</p>