From 193f208d807ac5dd65ce1bf5f46c3a895898dcf0 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sun, 1 Mar 2026 04:27:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Windows=20=E4=B8=8A?= =?UTF-8?q?=20Ctrl+V=20=E7=B2=98=E8=B4=B4=E5=A4=B1=E6=95=88=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20KeyDown/KeyUp=20=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E4=BF=AE=E9=A5=B0=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/paste/paste.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/paste/paste.go b/internal/paste/paste.go index 53bd985..a7558b4 100644 --- a/internal/paste/paste.go +++ b/internal/paste/paste.go @@ -43,13 +43,20 @@ func ClipboardOnly(text string) { } func simulatePaste() error { + var modifier, key string switch runtime.GOOS { case "darwin": - robotgo.KeyTap("v", "command") + modifier, key = "command", "v" case "linux", "windows": - robotgo.KeyTap("v", "control") + modifier, key = "ctrl", "v" default: return fmt.Errorf("unsupported platform: %s", runtime.GOOS) } + + robotgo.KeyDown(modifier) + time.Sleep(20 * time.Millisecond) + robotgo.KeyTap(key) + time.Sleep(20 * time.Millisecond) + robotgo.KeyUp(modifier) return nil }