Skip to content

Keep F9 dictation from sticking when another key is pressed while it's held - #13486

Closed
slogonomo wants to merge 4 commits into
omacom:quattrofrom
slogonomo:voxtype-ptt-transparent-release
Closed

slogonomo wants to merge 4 commits into
omacom:quattrofrom
slogonomo:voxtype-ptt-transparent-release

Conversation

@slogonomo

Copy link
Copy Markdown

Problem

F9 push-to-talk dictation gets stuck recording if another key is pressed while F9 is held. Hold F9, tap any key, then release F9: voxtype record stop never runs, and recording continues until voxtype's max_duration_secs cutoff (60 s by default).

With voxtype streaming enabled ([parakeet] streaming = true), this happens on nearly every use. voxtype types text through wtype while F9 is still held, and each typed key has the same effect. voxtype avoids this for its own evdev hotkey by forcing toggle mode when streaming is on, but Omarchy's F9 binding goes through Hyprland, so it just gets stuck.

Cause

This is Hyprland's bind shadowing (v0.56.2, src/managers/KeybindManager.cpp):

  • When any key is released, shadowKeybinds() (L434) marks every bind whose key is still in m_pressedKeys as shadowed (L855–L898). F9 is still held, so its release bind is shadowed.
  • When F9 is released, handleKeybinds skips shadowed binds (L652), so the stop never fires.

Change

Mark the release bind as transparent, which Hyprland never shadows. In default/hypr/bindings/voxtype.lua:

o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true, transparent = true, ignore_mods = true })

transparent = true is the actual fix. ignore_mods = true is optional hardening: without it, releasing F9 while Shift is down (by the user, or by wtype typing a capital letter) fails the modifier check and the stop is skipped again.

Tested on Omarchy 4.0.4, Hyprland 0.56.2 and voxtype 1.0.1 with Parakeet streaming: push-to-talk now stops reliably on release, including while text is being typed.

Related (voxtype, not Omarchy)

With streaming, words still being processed when F9 is released are dropped by voxtype itself, which discards in-flight text on stop. Reported upstream: peteonrails/voxtype#804. Locally I work around it by delaying the stop (sh -c 'sleep 1; voxtype record stop'), but the right delay depends on hardware and model settings, so I'm not proposing it here.

🤖 Generated with Claude Code

…s held

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@J0UH

J0UH commented Sep 28, 2026

Copy link
Copy Markdown

Confirming this on a second machine, and without streaming: ASUS ZenBook S UX391UA, Omarchy 4.0.4, Hyprland 0.56.2, voxtype 1.1.0 with Omarchy's default voxtype config (Whisper base.en, no streaming). With the default binding, releasing F9 sometimes left recording running until I clicked F9 again. Without streaming nothing is typed while F9 is held, so what triggers it is whatever key I touch while talking.

To check which bind options matter, I added a test key bound exactly like F9 (a press bind plus a release bind on a key name) with hyprctl eval, and drove it with wtype:

Release bind options Plain press and release Another key tapped while held Modifier down at release
release (current default) stops stop lost stop lost
release, ignore_mods stops stop lost stops
release, transparent, ignore_mods (this PR) stops stops stops

The two triggers are independent, so both options are needed: transparent for the shadowing and ignore_mods for the modifier check. I've been running the binding from this PR locally since.

@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
With ignore_mods, the push-to-talk release bind matches every modifier+F9 chord, and Hyprland consumes the press of a matching release bind, so apps stopped receiving Shift+F9, Ctrl+F9 and Alt+F9 (debug, build and run in IntelliJ, among others) on any machine with voxtype. Non-consuming passes those presses through while keeping the release stop; plain F9 is still consumed by the start bind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the remaining test-coverage concern is non-blocking.

Findings

  1. P2 New binding flags go untested ▶

Summary

The PR makes F9 and right-Alt dictation release bindings transparent so another key press does not shadow the stop action.

  • The F9 binding also ignores modifiers and does not consume the key, preserving modified application shortcuts.
  • No distinct new issue was established in the changes since the previous review.

Reviews (2) · Last reviewed commit: "Keep right-Alt dictation from sticking w..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Reproduced and verified on a VM built from the Omarchy ISO (Hyprland 0.56.2), with voxtype stubbed to log its calls and F9 driven through wtype. On quattro, the stop was lost every time another key was tapped while F9 was held, and every time F9 was released with Shift down. With this change, both cases fired voxtype record stop 3 of 3, and a plain press and release still did too. Each flag covers one of the two triggers, matching the table @J0UH posted.

I pushed one fix, 35bb4a2. With ignore_mods, the release bind also matches Shift+F9, Ctrl+F9 and Alt+F9, and Hyprland swallows the press of a matching release bind. On the worker, a focused terminal stopped receiving those chords at 3b91d0c, while quattro delivers them. That breaks app shortcuts like IntelliJ's Shift+F9 and Ctrl+F9 on any machine with dictation installed. Adding non_consuming = true gives the chords back to apps, and all three stop cases still pass. A plain F9 still reaches no app, because the start bind consumes it.

One thing is left for the maintainer to decide. Shift/Ctrl/Alt+F9 still runs voxtype record stop. So an app shortcut on a modified F9 ends dictation that was started with Super+Ctrl+X. No combination of bind flags avoids that. It would take remembering in Lua whether plain F9 started the recording, which is more than this fix should carry.

./test/cli passed except vscode generated theme references current theme file, which fails the same way without this change. The Hyprland binding-conflicts, default-config, reload-guard, keybindings-menu and voxtype tests all passed on the worker.

Second opinion: Codex Medium, over two rounds. It raised the swallowed modifier+F9 chords, which I then confirmed on the worker, and the toggle-dictation side effect above. It also agreed with the cause and with each flag's role, though its independence from this review is not guaranteed. This is waiting on the maintainer.

Comment thread default/hypr/bindings/voxtype.lua Resolved
Comment thread default/hypr/bindings/voxtype.lua Outdated
o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true })
-- Transparent so keys pressed while F9 is held (including voxtype streaming output) can't shadow the release
-- Non-consuming so ignore_mods doesn't swallow app shortcuts like Shift+F9 and Ctrl+F9
o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true, transparent = true, ignore_mods = true, non_consuming = true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 New binding flags go untested The existing binding tests record the key, description, and release setting, but discard transparent, ignore_mods, and non_consuming. They would still pass if a flag needed to prevent stuck recording or preserve modified F9 app shortcuts were removed, leaving these changes open to a silent regression. Please assert the new options and their intended shortcut behavior.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 8, 2026
omarchybot and others added 2 commits October 9, 2026 01:02
quattro moved the dictation bindings from voxtype.lua to dictation.lua and routed them through omarchy-dictation, so the release-bind flags move to the F9 stop bind there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ile it's held

The ALT + Alt_R push-to-talk release bind is shadowed exactly like F9's was: tapping any key while Alt_R is held drops the stop. On a Hyprland 0.56.2 worker the stop was lost 3 of 3 without transparent and fired 3 of 3 with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 8, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging after quattro moved the dictation bindings from voxtype.lua to default/hypr/bindings/dictation.lua (#14552), so I merged quattro into the branch and carried the fix across (b223aff). The flags now sit on the F9 release bind there, which runs omarchy-dictation stop.

quattro also added a second push-to-talk key, right Alt, and its release bind has the same problem. Tapping any key while right Alt is held drops the stop. I pushed da08ed3, which adds transparent = true to that release bind. It already had ignore_mods.

I re-verified at da08ed3 on a VM built from the Omarchy ISO (Hyprland 0.56.2), with voxtype stubbed to log its calls and the keys driven through wtype. On quattro, the stop was lost 3 of 3 times when a key was tapped while F9 was held, when Shift was down as F9 was released, and when a key was tapped while right Alt was held. At this head, all of those fired the stop 3 of 3, and a plain press and release of either key still did. Shift+F9, Ctrl+F9 and Alt+F9 still reached a focused terminal. ./test/cli passed in full, and so did the dictation, default-config, binding-conflicts, keybindings-menu and reload-guard tests on the worker.

Second opinion: Codex Medium reviewed this head and found nothing to change. It agreed with the merge resolution, with the right Alt change, and that right Alt doesn't need non_consuming, because its press bind already consumes the key. Its independence from this review isn't guaranteed.

Two things are for the maintainer. First, the question from my last comment still stands: because of ignore_mods, Shift/Ctrl/Alt+F9 in an app still ends dictation that was started with Super+Ctrl+X. Second, #14629 rewrites these same binding lines, so whichever of the two lands second needs a one-line conflict fix. This is waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 9, 2026
@slogonomo

Copy link
Copy Markdown
Author

Superseded by #14645, which fixes both push-to-talk keys with o.bind_hold (a transparent, ignore_mods, non_consuming release). Closing. Thanks @omarchybot for carrying this across the bindings move.

@slogonomo slogonomo closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants