diff --git a/VoiceInk/HotkeyManager.swift b/VoiceInk/HotkeyManager.swift index f9f3e71..63834f1 100644 --- a/VoiceInk/HotkeyManager.swift +++ b/VoiceInk/HotkeyManager.swift @@ -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 diff --git a/VoiceInk/Views/Settings/SettingsView.swift b/VoiceInk/Views/Settings/SettingsView.swift index 8d66cc6..2201d2d 100644 --- a/VoiceInk/Views/Settings/SettingsView.swift +++ b/VoiceInk/Views/Settings/SettingsView.swift @@ -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",