Add a send key that presses Return after the paste - #20
Merged
Merged
Conversation
Press a second chord, Right Option by default, at any point while the push-to-talk key is held and Return follows the pasted text, so a chat message is sent or a command runs without a second trip to the keyboard. The send key is recorded in Settings like the push-to-talk key; an empty chord in settings.json turns it off. The press latches for the rest of the recording, so release order does not matter. The send key is swallowed only while the chord is engaged and passes through otherwise. The watchdog release never submits, and short, cancelled or empty dictations press nothing. The Return is posted from a detached task 50 ms after Cmd+V, off the release-to-paste path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
Press a second chord, Right Option by default, at any point while the push-to-talk key is held, and Return follows the pasted text. That sends a chat message or runs a terminal command without a second trip to the keyboard. The send key is recorded in Settings like the push-to-talk key. An empty chord in
settings.jsonturns it off.Behaviour
Where
HotkeyChordTrackergainssubmitKeyandisSubmitArmed;HotkeyEvent.releasedcarriessubmit: Bool.DictationCoordinatorthreads the flag from the release intoTextOutput.insert(_:submit:).PasteboardOutputposts Return from a detached task 50 ms after Cmd+V, with no modifier flags, so it stays off the release-to-paste path and a still-held Option cannot turn it into Option+Return.Settings.submitKey, a second recorder row in Settings, README FAQ and the CLAUDE.md decisions table.Benchmark
Skipped on purpose. The change threads a flag through
finishandinsertand the engine call is untouched; the benchmark only timesengine.transcribe, so it could not show a difference. A real dictation on this branch logged release-to-paste 0.288 s for 9.9 s of audio with engine 0.212 s, in line with the M1 baseline.Tests
swift test: 84 tests pass, including 10 new tracker tests and 5 new coordinator tests. Verified live with Fn as the push-to-talk key and Left Control as the send key.Implementation was drafted by OpenCode running GLM 5.3 Flash from a written spec and reviewed by hand.
🤖 Generated with Claude Code