Page 1 of 1

key cancels out action

Posted: 14 May 2021, 18:34
by iCop

Code: Select all

Loop {
Send, {Key1}
Sleep, 50
Send, {Key2}
Sleep, 3900
}

Pause::ExitApp
[Mod edit: [code][/code] tags added.]

If another key is pressed during one of these actions the action cancels out and doesn't execute.
If you know the fix for this problem it would be greatly appreciated if you replied with the fix.

Re: key cancels out action

Posted: 14 May 2021, 20:38
by mikeyww
Is that the entire script? I tried the following with no difficulty.

Code: Select all

Loop {
 Send 1
 Sleep, 50
 Send 2
 Sleep, 3900
}

Re: key cancels out action

Posted: 15 May 2021, 01:32
by Rohwedder
Hallo,
try:

Code: Select all

SetTimer, Key1_2, 3950
Key1_2:
Send, {Key1}
Sleep, 50
Send, {Key2}
Return

Pause::ExitApp

Re: key cancels out action

Posted: 15 May 2021, 05:00
by iCop
mikeyww wrote:
14 May 2021, 20:38
Is that the entire script? I tried the following with no difficulty.

Code: Select all

Loop {
 Send 1
 Sleep, 50
 Send 2
 Sleep, 3900
}
Yes indeed that was the whole script. Thanks a lot for the help.

Re: key cancels out action

Posted: 15 May 2021, 06:22
by mikeyww
Rohwedder's timer idea seems like a good bet. Let us know!