剪切、复制、粘贴时发出哔哔声或发出声音

JMS*_*JMS 5 audio clipboard autohotkey macros windows-10

我在 Windows 10 中安装了 autohotkey。我如何在剪切、复制或粘贴某些内容时让它“发出哔哔声”或发出声音。

我正在处理一个巨大的记录,其中涉及剪切-复制-粘贴数据。问题是有时当我复制文本然后粘贴它时,会粘贴以前的数据而不是新数据。这是因为有时我按下了不同的按钮(而不是 Ctrl+C Ctrl+X),或者可能是轻轻按下了键盘按钮等)

所以现在,我想确保它已经被复制、剪切或粘贴,所以我想在每次它执行时听到声音 剪贴板中的新数据真的存在。

Rel*_*lax 3

#Persistent            ; keeps a script permanently running

    OnClipboardChange: ; is launched automatically whenever the content of the clipboard changes
time_copied :=""
time_copied :=  A_TickCount
; SoundBeep            ; Play the default pitch and duration.
SoundBeep, 750, 500    ; Play a higher pitch for half a second
If (A_EventInfo = 1)   ; the clipboard contains text or files copied
{
    If (DllCall("IsClipboardFormatAvailable", "uint", 15))  ; the clipboard contains file(s)
        ToolTip, file(s) copied
    else
        ToolTip, text copied
}
else
If (A_EventInfo = 2)   ; the clipboard contains images
    ToolTip, image(s) copied
Sleep 1000
ToolTip
return

; ctrl+v for pasting
~^v::   
    SoundBeep
    time_since_copied := (A_TickCount - time_copied)
    time_since_copied /= 1000
    ToolTip, pasted`ncopied: %time_since_copied% seconds ago
    Sleep, 1500
    ToolTip
return
Run Code Online (Sandbox Code Playgroud)

详细信息请参见OnClipboardChange