Code:
SC122 Down::
MyVar2 = 1
Sleep 600
MyVar2 = 0
Return
SC122 Up::
If MyVar2 = 1
{
Send p
}
else
{
Send {Space}
}
Return
SC122 is a button on the front of my HTPC case
The above script does the follow
If SC122 key is pressed once it sends a "p" (Play)
If SC122 key is pressed and held for >600 it sends a "space" (Pause) on release of the SC122 key
I would like to modify the script to send the space after 600ms rather than waiting for the key release. I would also like it to send a space rather than the "p" if it is double clicked within 250ms
ie
Press SC122 -> Wait 250ms, if it's only pressed once send a "p"
Press SC122 twice quickly within 250ms -> Send "Space" (Do not send a "p")
Press and hold SC122 for > 600ms -> Send a "Space", rather than waiting for release of the key