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/Services/AudioRecordingService.swift b/speaktype/Services/AudioRecordingService.swift index a164039..1ddaaee 100644 --- a/speaktype/Services/AudioRecordingService.swift +++ b/speaktype/Services/AudioRecordingService.swift @@ -356,6 +356,7 @@ class AudioRecordingService: NSObject, ObservableObject { self.captureSession?.stopRunning() self.isStopping = false self.shouldDiscardCurrentRecordingOutput = false + self.captureSession?.stopRunning() // ← ADD THIS LINE continuation.resume(returning: finalizedRecordingURL) } } diff --git a/speaktype/Services/ClipboardService.swift b/speaktype/Services/ClipboardService.swift index e5033eb..2536c6e 100644 --- a/speaktype/Services/ClipboardService.swift +++ b/speaktype/Services/ClipboardService.swift @@ -10,29 +10,31 @@ class ClipboardService { } private init() {} - - // Copy text to system clipboard with optional promotional wrapper + + private func wrapTextIfNeeded(_ text: String) -> String { + return text + } + 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!") + + // 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() { // Create a concurrent task to avoid blocking main thread if needed, 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")