Skip to content

Commit

Permalink
Fix write(exact=True) mishandling \n and \b on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
boppreh committed Feb 25, 2018
1 parent f9b1c61 commit f5bf61c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keyboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,10 @@ def write(text, delay=0, exact=_platform.system() == 'Windows'):
# Window's typing of unicode characters is quite efficient and should be preferred.
if exact:
for letter in text:
if letter == '\n':
if letter in '\n\b':
send(letter)
_os_keyboard.type_unicode(letter)
else:
_os_keyboard.type_unicode(letter)
if delay: _time.sleep(delay)
else:
for letter in text:
Expand Down

0 comments on commit f5bf61c

Please sign in to comment.