Skip to content

Instantly share code, notes, and snippets.

@skahack
Created June 6, 2011 14:58
Show Gist options
  • Save skahack/1010405 to your computer and use it in GitHub Desktop.
Save skahack/1010405 to your computer and use it in GitHub Desktop.
Backspace、Function keyなどのイベントを送信
const unichar ch = NSBackspaceCharacter;
NSString *backspace = [NSString stringWithCharacters:&ch length:1];
NSEvent *e = [NSEvent keyEventWithType:NSKeyDown
location:NSMakePoint(0, 0)
modifierFlags:0
timestamp:0
windowNumber:0
context:[NSGraphicsContext currentContext]
characters:backspace
charactersIgnoringModifiers:backspace
isARepeat:NO
keyCode:0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment