Configurable shortcut for pasting the last transcription.

This commit is contained in:
Beingpax 2025-08-08 21:08:21 +05:45
parent 0c517c728b
commit 12f90c53d9
2 changed files with 22 additions and 3 deletions

View File

@ -121,9 +121,11 @@ class HotkeyManager: ObservableObject {
self.whisperState = whisperState
self.miniRecorderShortcutManager = MiniRecorderShortcutManager(whisperState: whisperState)
// Register Paste Last Transcription shortcut (Control + V)
let pasteShortcut = KeyboardShortcuts.Shortcut(.v, modifiers: [.control])
KeyboardShortcuts.setShortcut(pasteShortcut, for: .pasteLastTranscription)
if KeyboardShortcuts.getShortcut(for: .pasteLastTranscription) == nil {
let defaultPasteShortcut = KeyboardShortcuts.Shortcut(.v, modifiers: [.control])
KeyboardShortcuts.setShortcut(defaultPasteShortcut, for: .pasteLastTranscription)
}
KeyboardShortcuts.onKeyUp(for: .pasteLastTranscription) { [weak self] in
guard let self = self else { return }
Task { @MainActor in

View File

@ -106,6 +106,23 @@ struct SettingsView: View {
}
}
SettingsSection(
icon: "doc.on.clipboard.fill",
title: "Paste Last Transcription",
subtitle: "Configure shortcut to paste your most recent transcription"
) {
HStack(spacing: 12) {
Text("Paste Shortcut")
.font(.system(size: 13, weight: .medium))
.foregroundColor(.secondary)
KeyboardShortcuts.Recorder(for: .pasteLastTranscription)
.controlSize(.small)
Spacer()
}
}
// Recording Feedback Section
SettingsSection(
icon: "speaker.wave.2.bubble.left.fill",