Skip to content

Instantly share code, notes, and snippets.

@willwade
Last active August 29, 2015 14:02
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 willwade/52ccf1455772d6597c30 to your computer and use it in GitHub Desktop.
Save willwade/52ccf1455772d6597c30 to your computer and use it in GitHub Desktop.
pykeyboard on mac demo
from pykeyboard import PyKeyboard
# Works
k = PyKeyboard()
k.press_key('Command')
k.press_key('tab')
k.release_key('command')
k.release_key('tab')
#works
k = PyKeyboard()
k.press_key('Command')
k.press_key('space')
k.release_key('command')
k.release_key('space')
k.type_string('System Preferences')
# now works
k.press_key('Command')
k.press_key('shift')
k.press_key('3')
k.release_key('command')
k.release_key('shift')
k.press_key('3')
# works
k = PyKeyboard()
k.press_key('Command')
k.press_key('option')
k.press_key('t')
k.release_key('command')
k.release_key('option')
k.release_key('t')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment