Add Esc cancel support

This commit is contained in:
Thales Maciel 2026-02-24 14:23:03 -03:00
parent b3be444625
commit f9224621fa
No known key found for this signature in database
GPG key ID: 33112E6833C34679
6 changed files with 19 additions and 0 deletions

View file

@ -66,6 +66,10 @@ class X11Adapter:
thread = threading.Thread(target=self._listen, args=(hotkey, callback), daemon=True)
thread.start()
def start_cancel_listener(self, callback: Callable[[], None]) -> None:
thread = threading.Thread(target=self._listen, args=("Escape", callback), daemon=True)
thread.start()
def inject_text(self, text: str, backend: str) -> None:
backend = (backend or "").strip().lower()
if backend in ("", "clipboard"):