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 }