key cancels out action

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
iCop
Posts: 2
Joined: 14 May 2021, 18:22

key cancels out action

Post by iCop » 14 May 2021, 18:34

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.
User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: key cancels out action

Post by mikeyww » 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
}
Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: key cancels out action

Post by Rohwedder » 15 May 2021, 01:32

Hallo,
try:

Code: Select all

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

Pause::ExitApp
iCop
Posts: 2
Joined: 14 May 2021, 18:22

Re: key cancels out action

Post by iCop » 15 May 2021, 05:00

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.
User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: key cancels out action

Post by mikeyww » 15 May 2021, 06:22

Rohwedder's timer idea seems like a good bet. Let us know!
Post Reply

Return to “Ask for Help (v1)”