Skip to content

feat(hotkey): double-tap to latch push-to-talk on - #833

Open
someonewithpc wants to merge 1 commit into
peteonrails:devfrom
someonewithpc:feat/double-tap-latch
Open

someonewithpc wants to merge 1 commit into
peteonrails:devfrom
someonewithpc:feat/double-tap-latch

Conversation

@someonewithpc

Copy link
Copy Markdown

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 before

With 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 TapLatch state machine in the evdev listener, with unit tests for the double tap, a lone tap and a normal long press

Related Issue

#832

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • I have tested these changes locally
  • I have run cargo test and all tests pass
  • I have run cargo clippy -- -D warnings with no warnings
  • I have run cargo fmt

Documentation

  • I have updated documentation as needed
  • No documentation changes are needed

Pre-merge checklist

  • This PR targets the dev branch (not main)
  • Wait for ci-success to 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

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.
@someonewithpc

Copy link
Copy Markdown
Author

CI runs correctly locally. Can a maintainer approve the CI workflow?

Apologies if I misunderstood the workflow

@someonewithpc
someonewithpc marked this pull request as ready for review October 5, 2026 16:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant