From 7f511453b0119de2e55b991957a45d4dc87d9d2b Mon Sep 17 00:00:00 2001 From: Gkrezel Date: Sun, 23 Aug 2020 23:53:12 -0400 Subject: [PATCH] fixes to add_abbreviation for linux Fixed strange behaviour on linux from the add_abbreviation funtion by adding a slight delay slight delay between characters --- keyboard/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboard/__init__.py b/keyboard/__init__.py index a04da7cc..b964f768 100644 --- a/keyboard/__init__.py +++ b/keyboard/__init__.py @@ -1148,7 +1148,8 @@ def add_abbreviation(source_text, replacement_text, match_suffix=False, timeout= For more details see `add_word_listener`. """ replacement = '\b'*(len(source_text)+1) + replacement_text - callback = lambda: write(replacement) + if _platform.system() == 'Linux': callback = lambda: write(replacement,delay=.001) + else: callback = lambda: write(replacement) return add_word_listener(source_text, callback, match_suffix=match_suffix, timeout=timeout) # Aliases.