Skip to content

Commit

Permalink
Add micro delay with OSX keypresses
Browse files Browse the repository at this point in the history
Recent operating system update appears to require this
Otherwise the typing can be too quick and letters are lost
  • Loading branch information
seananderson authored and dylan-chong committed Jul 8, 2018
1 parent fb67d03 commit b9dcd90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/osx/server_osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ def write_text(text, paste=False):
if text:
script = applescript.AppleScript('''
tell application "System Events"
keystroke "{text}"
repeat with i from 1 to count characters of "{text}"
keystroke (character i of "{text}")
delay 0.0002
end repeat
end tell
'''.format(text=text))
script.run()
Expand Down

0 comments on commit b9dcd90

Please sign in to comment.