Unknow0059
Unknow0059

Reputation: 133

Make a key send 2 different keys but wait X time to send the second one?

This is my code

3::
send, {1}
sleep, 500
send, {3}

return

It's not working it just sends the rest as text instead of executing them as commands, and it's looping for some reason. I pressed "3" twice in this gif.

enter image description here

Upvotes: 0

Views: 517

Answers (1)

Robert Ilbrink
Robert Ilbrink

Reputation: 7973

As mentioned by user3419297, The problem is that as soon as the scirpt sends out "3", it is seen by the script as the trigger to start all over again. Just as when you type 3 on the keboard it is seen as a trigger to run the script. This 3 (whether typed by you or by the script) will therefore never be printed. Placing a $-sign in front of the trigger prevents the script from triggering itself. With the $-sign, the script will only listen to the keyboard.

Upvotes: 1

Related Questions