title: How press "shift" + "command" + "3" simultaneously programmatically
body: <p>I am trying to capture a screenshot by posting this Keyboard event. I tried below way which doesn't work:</p>
  
  <p>1]</p>
  
  <pre><code>CGEventRef event1, event2, event3, event4, event5, event6;
  event1 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)56, true);
  event2 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)55, true);
  event3 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)85, true);//or 20
  event4 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)85, false);// or 20
  event5 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)55, false);
  event6 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)56, false);
  
  CGEventPost(kCGSessionEventTap, event1);
  CGEventPost(kCGSessionEventTap, event2);
  CGEventPost(kCGSessionEventTap, event3);
  
  CGEventPost(kCGSessionEventTap, event4);
  CGEventPost(kCGSessionEventTap, event5);
  CGEventPost(kCGSessionEventTap, event6);
  
  CFRelease(event1);
  CFRelease(event2);
  CFRelease(event3);
  CFRelease(event4);
  CFRelease(event5);
  CFRelease(event6);
  </code></pre>
  
  <p>2] </p>
  
  <pre><code>CGEventRef event7;
  event7 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)85, true);//or 20
  CGEventSetFlags(event7, kCGEventFlagMaskShift);
  CGEventSetFlags(event7, kCGEventFlagMaskCommand);
  CGEventPost(kCGSessionEventTap, event7);
  CFRelease(event7);
  </code></pre>
  
  <p>Both are not working. Suggest me any good option.</p>