Skip to content

Instantly share code, notes, and snippets.

@jmercouris
Created November 16, 2018 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmercouris/ec1c5b50106b3cc02d735b05fadc1737 to your computer and use it in GitHub Desktop.
Save jmercouris/ec1c5b50106b3cc02d735b05fadc1737 to your computer and use it in GitHub Desktop.
dispatch_sync(dispatch_get_main_queue(), ^{
if ([event timestamp] != 1) {
[super sendEvent: [NSEvent keyEventWithType:NSEventTypeKeyDown
location:[event locationInWindow]
modifierFlags:[event modifierFlags]
timestamp:1
windowNumber:[event windowNumber]
context:nil
characters:[event characters]
charactersIgnoringModifiers:[event charactersIgnoringModifiers]
isARepeat:[event isARepeat]
keyCode:[event keyCode]]];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment