Repository navigation
feat(hotkey): double-tap to latch push-to-talk on - #833
Open
someonewithpc wants to merge 1 commit into
Open
someonewithpc wants to merge 1 commit into
someonewithpc wants to merge 1 commit into
Conversation
Holding the hotkey through a long dictation is tiring, and switching to toggle mode gives up push-to-talk for short ones. With hotkey.double_tap_latch, a double tap keeps the recording running after the key is released, until the next press. Holding the key works as before. A single tap under 250 ms waits 300 ms for a second one and is then discarded, since a recording that short was a tap, not speech. Off by default; ignored in toggle mode. The timing lives in a small TapLatch state machine with unit tests.
Author
|
CI runs correctly locally. Can a maintainer approve the CI workflow? Apologies if I misunderstood the workflow |
someonewithpc
marked this pull request as ready for review
October 5, 2026 16:52
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Holding the hotkey through a long dictation gets annoying, and toggle mode gives up push-to-talk for the short ones. With
hotkey.double_tap_latch = true, a double tap keeps the recording running after the key is released, until the next press. Holding the key works exactly as beforeWith the option on, a single tap shorter than 250 ms waits 300 ms for a second tap and is then discarded, since a recording that short was a tap, not speech. Off by default and ignored in toggle mode
The timing lives in a small
TapLatchstate machine in the evdev listener, with unit tests for the double tap, a lone tap and a normal long pressRelated Issue
#832
Type of Change
Testing
cargo testand all tests passcargo clippy -- -D warningswith no warningscargo fmtDocumentation
Pre-merge checklist
devbranch (notmain)ci-successto pass before marking Ready for Review (draft mode is encouraged while CI is red)Additional Notes
The 250/300 ms values are constants; I can make them configurable if you'd like
This overlaps a little with #718 (
min_hold_ms), which also discards short taps. If both land, they'll need a look at how they interact; I haven't tried them together