SendClipboardAsKeystrokes.ahk
· 833 B · AutoHotkey
Исходник
;--------------------------------------------------------------
; This script sends clipboard text as keystrokes with Ctrl+Shift+V.
; Useful when native paste doesn't work (e.g. SSH, RDP).
; Features:
; - Shows a tooltip if the clipboard is empty.
; - Adjustable SetKeyDelay for terminals that need slower input.
; - Does NOT override normal Ctrl+V.
;--------------------------------------------------------------
; Adjust key delay here (ms between keys, ms press duration):
SetKeyDelay(20, 20) ; Increase delay if remote session drops characters
^+v:: ; Ctrl + Shift + V
{
if (A_Clipboard = "") {
; Clipboard empty – show a quick notification
Tooltip, ⚠️ Clipboard is empty!
SetTimer, RemoveTooltip, -1500
return
}
Send(A_Clipboard)
}
return
RemoveTooltip:
Tooltip
return
| 1 | ;-------------------------------------------------------------- |
| 2 | ; This script sends clipboard text as keystrokes with Ctrl+Shift+V. |
| 3 | ; Useful when native paste doesn't work (e.g. SSH, RDP). |
| 4 | ; Features: |
| 5 | ; - Shows a tooltip if the clipboard is empty. |
| 6 | ; - Adjustable SetKeyDelay for terminals that need slower input. |
| 7 | ; - Does NOT override normal Ctrl+V. |
| 8 | ;-------------------------------------------------------------- |
| 9 | |
| 10 | ; Adjust key delay here (ms between keys, ms press duration): |
| 11 | SetKeyDelay(20, 20) ; Increase delay if remote session drops characters |
| 12 | |
| 13 | ^+v:: ; Ctrl + Shift + V |
| 14 | { |
| 15 | if (A_Clipboard = "") { |
| 16 | ; Clipboard empty – show a quick notification |
| 17 | Tooltip, ⚠️ Clipboard is empty! |
| 18 | SetTimer, RemoveTooltip, -1500 |
| 19 | return |
| 20 | } |
| 21 | Send(A_Clipboard) |
| 22 | } |
| 23 | return |
| 24 | |
| 25 | RemoveTooltip: |
| 26 | Tooltip |
| 27 | return |
| 28 |