title: NSEvent addGlobalMonitorForEventsMatchingMask: Hotkey Intercepting
body: <p>I wanna intercept hotkeys that begin with <kbd>Control</kbd>+<kbd>Shift</kbd> and ends with a character (mandatory).<br>
  I have the following code:</p>
  
  <pre><code>[NSEvent addGlobalMonitorForEventsMatchingMask:NSFlagsChangedMask handler: ^(NSEvent *event) {
      NSUInteger flags = [event modifierFlags] &amp; NSDeviceIndependentModifierFlagsMask;
      if(flags == NSControlKeyMask + NSShiftKeyMask){
          NSLog(@"pressed!");
      }
  }];
  </code></pre>
  
  <p>What do i need to add to my code to check if the user pressed <kbd>Control</kbd><kbd>Shift</kbd>+character, and what character the user pressed?
  <br>The code <code>NSLog(@"pressed!");</code> will be executed only if what i said above is true.<br><br>
  This is my pseudo-code for what i'm looking for:</p>
  
  <pre><code>[NSEvent addGlobalMonitorForEventsMatchingMask:NSFlagsChangedMask handler: ^(NSEvent *event) {
      NSUInteger flags = [event modifierFlags] &amp; NSDeviceIndependentModifierFlagsMask;
      if((flags == NSControlKeyMask + NSShiftKeyMask) &amp;&amp; [event containsCharacter]){
         NSLog(@"%@", [event character];
      }
  }];
  </code></pre>
  
  <p>So if the user presses <kbd>Control</kbd>+<kbd>Shift</kbd>+1 i'll do one thing, if <kbd>Control</kbd>+<kbd>Shift</kbd>+2 other thing, and so on...</p>