Skip to content

Add PTT debounce for mouse button support#114

Merged
Aaronontheweb merged 1 commit intomasterfrom
feature/ptt-debounce
Jan 23, 2026
Merged

Add PTT debounce for mouse button support#114
Aaronontheweb merged 1 commit intomasterfrom
feature/ptt-debounce

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Owner

Summary

Adds debounce support for push-to-talk to work with mouse buttons that send rapid key events.

Problem (#95)

Users mapping mouse side buttons to the PTT key (F9) get rapid key up/down events instead of proper press/release behavior. The mouse software sends a continuous stream of key down → key up → key down → ... while the button is held. This caused multiple tiny recordings instead of one continuous recording.

Solution

  • Add configurable debounce delay (default 30ms) via hotkeys.ptt_debounce_ms config option
  • When key is released, schedule stop after debounce delay
  • If key is pressed again before delay expires, cancel the pending stop
  • This coalesces rapid key events into a single recording session

Configuration

hotkeys:
  ptt_debounce_ms: 30  # default, can be adjusted or set to 0 to disable

Closes #95

Test plan

  • Test PTT with keyboard - should work as before
  • Test PTT with rapid key presses - should debounce into single recording
  • Test with ptt_debounce_ms: 0 - should have no debounce (immediate stop)
  • Run unit tests: pytest tests/ --ignore=tests/test_sleep_monitoring.py

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) January 23, 2026 12:31
Users mapping mouse side buttons to the PTT key (F9) get rapid key up/down
events instead of proper press/release behavior. This caused multiple tiny
recordings instead of one continuous recording.

Changes:
- Add configurable debounce delay (default 30ms) via hotkeys.ptt_debounce_ms
- When key is released, schedule stop after debounce delay
- If key is pressed again before delay expires, cancel the pending stop
- This allows using mouse buttons for push-to-talk effectively

The debounce can be disabled by setting ptt_debounce_ms to 0 in config.
@Aaronontheweb Aaronontheweb merged commit 70e4d8e into master Jan 23, 2026
6 checks passed
@Aaronontheweb Aaronontheweb deleted the feature/ptt-debounce branch January 23, 2026 15:14
Aaronontheweb added a commit that referenced this pull request Jan 23, 2026
Update CHANGELOG.md with v0.8.0 release notes including:
- PTT debounce support for mouse buttons (#114, #95)
- PyTorch 2.6+ compatibility fixes (#113, #102, #105)
- Transcription pipeline resilience improvements (#110, #106-#109)
@Aaronontheweb Aaronontheweb mentioned this pull request Jan 23, 2026
3 tasks
Aaronontheweb added a commit that referenced this pull request Jan 23, 2026
Update CHANGELOG.md with v0.8.0 release notes including:
- PTT debounce support for mouse buttons (#114, #95)
- PyTorch 2.6+ compatibility fixes (#113, #102, #105)
- Transcription pipeline resilience improvements (#110, #106-#109)
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.

Add tiny delay before doing stop_recording

1 participant