From bf3486615c5b94e4b47f4a8a437470c1fa749edd Mon Sep 17 00:00:00 2001 From: pydevp Date: Sun, 5 Oct 2025 09:50:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=B3=95=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E6=88=90=E5=8A=9F=E5=90=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=88=B0=E5=89=AA=E8=B4=B4=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qwen3-asr-studio/App.tsx | 3 ++- qwen3-asr-studio/components/PipView.tsx | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/qwen3-asr-studio/App.tsx b/qwen3-asr-studio/App.tsx index c4ccd33..46cb544 100644 --- a/qwen3-asr-studio/App.tsx +++ b/qwen3-asr-studio/App.tsx @@ -290,7 +290,8 @@ export default function App() { } if (result.transcription) { - setNotification({ message: '输入法模式识别成功', type: 'success' }); + // 画中画窗口已经完成了复制,这里只显示通知 + setNotification({ message: '输入法模式识别成功,已复制到剪贴板', type: 'success' }); } if (result.transcription) { diff --git a/qwen3-asr-studio/components/PipView.tsx b/qwen3-asr-studio/components/PipView.tsx index 3f5df41..a7bf87e 100644 --- a/qwen3-asr-studio/components/PipView.tsx +++ b/qwen3-asr-studio/components/PipView.tsx @@ -59,6 +59,22 @@ export const PipView: React.FC = ({ if (result.transcription) { setMessage(result.transcription); + + // 输入法模式复制结果到剪贴板 + try { + const textArea = document.createElement('textarea'); + textArea.value = result.transcription; + textArea.style.position = 'fixed'; + textArea.style.left = '-999999px'; + textArea.style.top = '-999999px'; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + } catch (copyError) { + console.error('复制失败:', copyError); + } + onTranscriptionResult({ transcription: result.transcription, detectedLanguage: result.detectedLanguage,