You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I was working on my joke project using this library and found a strange bug. The delay parameter in the write function does not work correctly on Mac OS. We don't wait every delay time before every letter input, but wait a delay before every word input.
This is very easy to fix. Like this:
defwrite(text, delay=0, restore_state_after=True, exact=None):
""" ... """ifexactisNone:
exact=_platform.system() =='Windows'state=stash_state()
# Window's typing of unicode characters is quite efficient and should be preferred.ifexact:
forletterintext:
ifletterin'\n\b':
send(letter)
else:
_os_keyboard.type_unicode(letter)
ifdelay: _time.sleep(delay)
else:
forletterintext:
try:
entries=_os_keyboard.map_name(normalize_name(letter))
scan_code, modifiers=next(iter(entries))
except (KeyError, ValueError):
_os_keyboard.type_unicode(letter)
# todo: We should add "if delay: _time.sleep(delay)" here.continueformodifierinmodifiers:
press(modifier)
_os_keyboard.press(scan_code)
_os_keyboard.release(scan_code)
formodifierinmodifiers:
release(modifier)
ifdelay:
_time.sleep(delay)
ifrestore_state_after:
restore_modifiers(state)
Should I create a PR for this?
The text was updated successfully, but these errors were encountered:
Hello! I was working on my joke project using this library and found a strange bug. The delay parameter in the write function does not work correctly on Mac OS. We don't wait every delay time before every letter input, but wait a delay before every word input.
This is very easy to fix. Like this:
Should I create a PR for this?
The text was updated successfully, but these errors were encountered: