Got keypresses working for OSX using AppleScript and Python subprocesses.