Skip to content

Instantly share code, notes, and snippets.

@eugenehp
Created July 19, 2012 21:33
Show Gist options
  • Save eugenehp/3146980 to your computer and use it in GitHub Desktop.
Save eugenehp/3146980 to your computer and use it in GitHub Desktop.
emulating Command-K keyboard event
CGEventRef eventCommandK = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)40, true);
CGEventSetFlags(eventCommandK, kCGEventFlagMaskCommand);
CGEventPost(kCGSessionEventTap, eventCommandK);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment