For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kwfine
Posts: 16
Joined: 26 Nov 2015, 06:46

For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?

03 Jun 2018, 13:01

Hi all,


For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?
I have used AHK for 2 years, but sometimes a simple code still confused me like this:

Code: Select all

Send, {CTRLDOWN}ax{CTRLUP}

Code: Select all

Sleep, 100
Send, {CTRLDOWN}
Sleep, 100
Send, ax
Sleep, 100
Send, {CTRLUP}
Sleep, 100
OR

Code: Select all

Sleep, 100
Send, {CTRL DOWN}
Sleep, 100
Send, ax
Sleep, 100
Send, {CTRL UP}
Sleep, 100

Thanks!


Kitty
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?

03 Jun 2018, 13:23

It isn't necessarily that AHK needs time to process, but the target program does. AHK can send input to a program too fast for it to handle at times.

You can try to avoid interlacing the Sleep, 100 by instead using SetKeyDelay.

CTRLDOWN isn't a key, but CTRL is. You can use Send {Ctrl Down} and Send {Ctrl Up}. So the last bit of code you used looks right; the first code, as a single line, needs the spaces between the L and D and the L and U.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Giresharu, inseption86, jomaweb, Rohwedder and 258 guests