Here is the code for one of my most used scripts which turns double taps of the Alt keys into Copy paste functions. I want to add a sound beep at the end of the copy loop to confirm that the script is running and working whenever I double tap LAlt, but SoundBeep will trigger every time I release the alt key even if doing so does not triggert hot key. It seems to happen regardless of where I put SoundBeep. Is there another way to verify that my double tap has sucessfully copied to the clipboard? The only other way I have pulled it off is a total pain.
~LAlt::
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200)
Run, %A_ScriptDir%\copysoundbeep.exe
return
Code: Select all
~LAlt up::
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200)
clipboard := "" ; empty clipboard
Loop
{
Send, ^c
ClipWait, 1 ; wait for the clipboard to contain data
if (!ErrorLevel) ; If NOT ErrorLevel clipwait found data on the clipboard
break
;SoundBeep, 750, 500
}
Return
~RAlt::
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200)
Send, ^v
Return