From c755c6efea5b5eb1085a927b788fa83a86a4f516 Mon Sep 17 00:00:00 2001 From: leonardotrapani Date: Sun, 15 Mar 2026 15:55:23 +0100 Subject: [PATCH] move bind vs bindr after push-to-talk, remove verbose explanation --- README.md | 14 +++++++------- docs/config.md | 18 ++++++------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 88c886b..1251039 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,6 @@ Run `hyprvoice configure` anytime for advanced settings. ## Hyprland Keybindings -Hyprland has two bind types that matter for voice input: - -- **`bind`** — fires when the key is **pressed down** -- **`bindr`** — fires when the key is **released** - ### Simple toggle ```bash @@ -121,9 +116,14 @@ bindr = SUPER, R, exec, hyprvoice toggle # key up → stop and transcribe This gives a walkie-talkie feel: hold the key while speaking, release when done. The daemon receives two `toggle` commands — the first starts recording, the second stops it and triggers transcription. -### Why `bindr` matters +### `bind` vs `bindr` -When you press SUPER+R with a regular `bind`, the SUPER modifier is still physically held when the command fires. If hyprvoice tries to inject text while SUPER is down, the compositor interprets the injected keystrokes as SUPER+key combos — leading to stuck modifiers, missed characters, or unexpected window management actions. `bindr` waits until you lift the key, ensuring a clean keyboard state for injection. +| Keyword | Fires on | +|---------|----------| +| `bind` | Key **press** (down) | +| `bindr` | Key **release** (up) | + +With `bindr`, modifier keys (SUPER, CTRL, etc.) are fully released before the command executes. This can prevent modifiers from interfering with text injection. ## Commands diff --git a/docs/config.md b/docs/config.md index 309fcef..0f119c4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -41,15 +41,6 @@ Configuration is stored in `~/.config/hyprvoice/config.toml` and changes are app Hyprvoice is triggered via Hyprland keybindings. The bind type you choose affects reliability and workflow. -### `bind` vs `bindr` - -| Keyword | Fires on | Use for | -|---------|----------|---------| -| `bind` | Key **press** (down) | Simple toggle, starting recording | -| `bindr` | Key **release** (up) | Stopping recording / injecting text | - -With `bindr`, modifier keys (SUPER, CTRL, etc.) are fully released before the command executes. This can prevent modifiers from interfering with text injection. - ### Simple toggle ```bash @@ -71,11 +62,14 @@ bindr = SUPER, R, exec, hyprvoice toggle # key up → stop and transcribe Hold the key while speaking, release when done. Both lines send `toggle` to the daemon — the first starts the pipeline, the second stops it. Because the stop fires on release, modifiers are clean for injection. -### Why modifier release matters +### `bind` vs `bindr` -When SUPER+R is pressed with a regular `bind`, the SUPER key is still physically held when `hyprvoice toggle` fires. If hyprvoice then injects text (via wtype or ydotool), the compositor sees SUPER+ for every keystroke — triggering window management shortcuts instead of typing. Using `bindr` for the stop/inject side ensures modifiers are released first. +| Keyword | Fires on | +|---------|----------| +| `bind` | Key **press** (down) | +| `bindr` | Key **release** (up) | -This is especially relevant if you use the `wtype` or `ydotool` injection backends. The `clipboard` backend is less affected since it uses paste rather than simulated keystrokes, but `bindr` is still recommended for consistency. +With `bindr`, modifier keys (SUPER, CTRL, etc.) are fully released before the command executes. This can prevent modifiers from interfering with text injection. ## Unified Provider System