feat(text-injection): speed up ydotool injection with explicit --key-delay (#488)

Pass --key-delay 8 to ydotool type instead of relying on the default
(12-20ms). This makes text injection ~3x faster while keeping key-delay
above zero to avoid the Shift-leak bug where capital letters corrupt
following characters.

The delay is configurable via VOCALINUX_YDOTOOL_KEY_DELAY env var.

Note: --key-hold flag from the original issue does not exist in standard
ydotool (verified against official man page and v1.0.4 source).

Fixes #482
This commit is contained in:
Jatin K Malik
2026-06-30 19:55:55 -07:00
committed by GitHub
parent 03b0efb51d
commit 34eb2f7ecf
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -205,9 +205,9 @@ class TestTextInjector(unittest.TestCase):
# Inject text
injector.inject_text("Hello world")
# Verify ydotool was called correctly
# Verify ydotool was called correctly with timing parameters
self.mock_subprocess.assert_any_call(
["ydotool", "type", "Hello world"],
["ydotool", "type", "--key-delay", "8", "Hello world"],
check=True,
stderr=subprocess.PIPE,
text=True,