Skip to content

Instantly share code, notes, and snippets.

@mattiasarro
Created July 1, 2015 18:04
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 mattiasarro/de6d5c7f4849271bd6a4 to your computer and use it in GitHub Desktop.
Save mattiasarro/de6d5c7f4849271bd6a4 to your computer and use it in GitHub Desktop.
k1 = function(str) { key = OSX.keyCodes[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k2 = function(str) { key = OSX.keyCodesRegular[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k3 = function(str) { key = OSX.keyCodesShift[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment