Skip to content

Add re-paste last transcription hotkey#135

Draft
topmonroe9 wants to merge 2 commits intosavbell:mainfrom
topmonroe9:feature/repaste-upstream
Draft

Add re-paste last transcription hotkey#135
topmonroe9 wants to merge 2 commits intosavbell:mainfrom
topmonroe9:feature/repaste-upstream

Conversation

@topmonroe9
Copy link

@topmonroe9 topmonroe9 commented Mar 10, 2026

Summary

When transcribed text doesn't paste correctly — the user may have switched windows, the target app may not have been focused, or clipboard paste may have failed — there's currently no way to re-insert the last transcription without recording again.

This adds a configurable repaste_key hotkey (default: ctrl+shift+v) that re-inserts the last transcribed text on demand.

  • New config option repaste_key in recording_options — auto-appears in settings UI
  • Refactored KeyListener from single chord to named chords dict, enabling multiple independent hotkeys
  • Stores last transcription result for re-use
  • Releases held modifier keys before typing to prevent interference (e.g. Ctrl+Shift still held when callback fires)
  • Repaste is ignored while recording/transcribing is in progress
  • Leave repaste_key empty in settings to disable

Note: The default ctrl+shift+v may conflict with "paste without formatting" in some applications. Users can change the hotkey in settings to avoid conflicts.

Files changed

File Change
src/config_schema.yaml Add repaste_key option
src/key_listener.py Refactor single chord → named chords dict
src/input_simulation.py Add release_held_modifiers()
src/main.py Store last transcription, add on_repaste(), update callback API

Test plan

  • Activation hotkey still works (record + transcribe)
  • Press ctrl+shift+v after transcription — last text re-inserted
  • Press repaste key with no prior transcription — silently does nothing
  • Press repaste key while recording — ignored
  • Settings UI shows the new repaste_key field
  • Change repaste key in settings, restart, verify new key works
  • Leave repaste key empty — feature disabled, no errors

🤖 Generated with Claude Code

topmonroe9 and others added 2 commits March 10, 2026 22:10
When transcribed text doesn't paste correctly (wrong window focused,
clipboard failure, etc.), users currently must re-record. This adds a
configurable hotkey to re-insert the last transcription on demand.

- Add `repaste_key` config option (default: ctrl+shift+v)
- Refactor KeyListener from single chord to named chords dict
- Store last transcription result for re-use
- Release held modifier keys before typing to prevent interference
- Settings UI auto-generates from schema, no UI changes needed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add time.sleep(0.05) after releasing modifiers in on_repaste to ensure
  OS processes synthetic key-up events before typing begins
- Clear stale chords in load_key_chords() so disabled repaste_key is
  properly removed on config reload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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