From 42ef8e288ed2db53ae708a082d18f612f4994d06 Mon Sep 17 00:00:00 2001 From: koc-Z3 Date: Mon, 23 Mar 2026 02:23:39 +1100 Subject: [PATCH 1/5] Add stopRunning call to AudioRecordingService --- speaktype/Services/AudioRecordingService.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/speaktype/Services/AudioRecordingService.swift b/speaktype/Services/AudioRecordingService.swift index e6c928b..12e588f 100644 --- a/speaktype/Services/AudioRecordingService.swift +++ b/speaktype/Services/AudioRecordingService.swift @@ -351,6 +351,7 @@ class AudioRecordingService: NSObject, ObservableObject { finishGroup.notify(queue: self.audioQueue) { self.isStopping = false self.shouldDiscardCurrentRecordingOutput = false + self.captureSession?.stopRunning() // ← ADD THIS LINE continuation.resume(returning: finalizedRecordingURL) } } From 825583fa4be68cb9bab20ea0a88bc8282df570a2 Mon Sep 17 00:00:00 2001 From: Z3 Date: Fri, 27 Mar 2026 18:42:51 +1100 Subject: [PATCH 2/5] Refactor copy method to type text directly Refactor copy method to type text directly instead of using clipboard. --- speaktype/Services/ClipboardService.swift | 36 +++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/speaktype/Services/ClipboardService.swift b/speaktype/Services/ClipboardService.swift index e5033eb..8ff28a8 100644 --- a/speaktype/Services/ClipboardService.swift +++ b/speaktype/Services/ClipboardService.swift @@ -11,27 +11,25 @@ class ClipboardService { private init() {} - // Copy text to system clipboard with optional promotional wrapper - func copy(text: String) { - let finalText = wrapTextIfNeeded(text) - - let pasteboard = NSPasteboard.general - pasteboard.clearContents() - pasteboard.setString(finalText, forType: .string) - - // Verify write - if let check = pasteboard.string(forType: .string), check == finalText { - print("✅ Clipboard Write Verified: '\(check.prefix(20))...'") - } else { - print("❌ Clipboard Write FAILED!") +func copy(text: String) { + let finalText = wrapTextIfNeeded(text) + + // Type each character directly without touching the clipboard + DispatchQueue.main.async { + let source = CGEventSource(stateID: .hidSystemState) + for scalar in finalText.unicodeScalars { + let char = UniChar(scalar.value) + var charArray = [char] + let keyDown = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: true) + keyDown?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) + let keyUp = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: false) + keyUp?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) + keyDown?.post(tap: .cghidEventTap) + keyUp?.post(tap: .cghidEventTap) } + print("✅ Typed directly: '\(finalText.prefix(20))...'") } - - // Wrap text with promotional message for free users - private func wrapTextIfNeeded(_ text: String) -> String { - // License check disabled - always allow unwrapped text - return text - } +} // Paste content (Simulate Cmd+V) func paste() { From 09026ebc083deca89965aacd7ffbd1542c52c946 Mon Sep 17 00:00:00 2001 From: Z3 Date: Fri, 27 Mar 2026 18:49:06 +1100 Subject: [PATCH 3/5] Refactor copy function for better readability --- speaktype/Services/ClipboardService.swift | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/speaktype/Services/ClipboardService.swift b/speaktype/Services/ClipboardService.swift index 8ff28a8..91d4ddb 100644 --- a/speaktype/Services/ClipboardService.swift +++ b/speaktype/Services/ClipboardService.swift @@ -11,25 +11,25 @@ class ClipboardService { private init() {} -func copy(text: String) { - let finalText = wrapTextIfNeeded(text) - - // Type each character directly without touching the clipboard - DispatchQueue.main.async { - let source = CGEventSource(stateID: .hidSystemState) - for scalar in finalText.unicodeScalars { - let char = UniChar(scalar.value) - var charArray = [char] - let keyDown = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: true) - keyDown?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) - let keyUp = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: false) - keyUp?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) - keyDown?.post(tap: .cghidEventTap) - keyUp?.post(tap: .cghidEventTap) + func copy(text: String) { + let finalText = wrapTextIfNeeded(text) + + // Type each character directly without touching the clipboard + DispatchQueue.main.async { + let source = CGEventSource(stateID: .hidSystemState) + for scalar in finalText.unicodeScalars { + let char = UniChar(scalar.value) + var charArray = [char] + let keyDown = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: true) + keyDown?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) + let keyUp = CGEvent(keyboardEventSource: source, virtualKey: 0, keyDown: false) + keyUp?.keyboardSetUnicodeString(stringLength: 1, unicodeString: &charArray) + keyDown?.post(tap: .cghidEventTap) + keyUp?.post(tap: .cghidEventTap) + } + print("✅ Typed directly: '\(finalText.prefix(20))...'") } - print("✅ Typed directly: '\(finalText.prefix(20))...'") } -} // Paste content (Simulate Cmd+V) func paste() { From c2d7135525c7f86249034fcb6e76429f18fd3334 Mon Sep 17 00:00:00 2001 From: Z3 Date: Fri, 27 Mar 2026 19:05:05 +1100 Subject: [PATCH 4/5] Implement wrapTextIfNeeded method in ClipboardService Add a private method to wrap text if needed before copying. --- speaktype/Services/ClipboardService.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/speaktype/Services/ClipboardService.swift b/speaktype/Services/ClipboardService.swift index 91d4ddb..2536c6e 100644 --- a/speaktype/Services/ClipboardService.swift +++ b/speaktype/Services/ClipboardService.swift @@ -10,7 +10,11 @@ class ClipboardService { } private init() {} - + + private func wrapTextIfNeeded(_ text: String) -> String { + return text + } + func copy(text: String) { let finalText = wrapTextIfNeeded(text) From 27455803fa1efcd04a24aedab8746c8247305a40 Mon Sep 17 00:00:00 2001 From: Kenny Chu Date: Fri, 27 Mar 2026 19:16:39 +1100 Subject: [PATCH 5/5] Replace clipboard copy with direct keystroke typing --- speaktype.xcodeproj/project.pbxproj | 4 ++-- speaktype/Controllers/MiniRecorderWindowController.swift | 2 +- speaktype/Views/TranscribeAudioView.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/speaktype.xcodeproj/project.pbxproj b/speaktype.xcodeproj/project.pbxproj index c1f01a5..69f2fec 100644 --- a/speaktype.xcodeproj/project.pbxproj +++ b/speaktype.xcodeproj/project.pbxproj @@ -433,7 +433,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 21; - DEVELOPMENT_TEAM = PCV4UMSRZX; + DEVELOPMENT_TEAM = STBJ5W6TPK; ENABLE_APP_SANDBOX = NO; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; @@ -467,7 +467,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 21; - DEVELOPMENT_TEAM = PCV4UMSRZX; + DEVELOPMENT_TEAM = STBJ5W6TPK; ENABLE_APP_SANDBOX = NO; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; diff --git a/speaktype/Controllers/MiniRecorderWindowController.swift b/speaktype/Controllers/MiniRecorderWindowController.swift index 85e27fe..3a136b0 100644 --- a/speaktype/Controllers/MiniRecorderWindowController.swift +++ b/speaktype/Controllers/MiniRecorderWindowController.swift @@ -140,7 +140,7 @@ class MiniRecorderWindowController: NSObject { // 6. Paste using CGEvent (Accessibility permission only) await MainActor.run { - ClipboardService.shared.paste() + //ClipboardService.shared.paste() } } } diff --git a/speaktype/Views/TranscribeAudioView.swift b/speaktype/Views/TranscribeAudioView.swift index 7d4b4a8..05690ae 100644 --- a/speaktype/Views/TranscribeAudioView.swift +++ b/speaktype/Views/TranscribeAudioView.swift @@ -139,7 +139,7 @@ struct TranscribeAudioView: View { .buttonStyle(.stSecondary) Button(action: { - ClipboardService.shared.paste() + //ClipboardService.shared.paste() }) { HStack(spacing: 6) { Image(systemName: "doc.on.clipboard")