SetKeyDelay not slowing Send output - Autohotkey v2.0.2 Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
want2learn
Posts: 2
Joined: 07 Feb 2023, 10:37

SetKeyDelay not slowing Send output - Autohotkey v2.0.2

Post by want2learn » 07 Feb 2023, 11:13

Hi

I want to use SetKeyDelay to slow the speed of Send characters but it doesn't seem to do this when I try it. For example, I was expecting a script only containing the following code to slowly display a row of dots one at a time when I press F9 in Windows NotePad or NotePad++. Changing SetKeyDelay to 10000 makes no difference.

Code: Select all

F9::
{
	SetKeyDelay 500
	Send ".............................."
	SetKeyDelay 0
}
I get the same result in Autohotkey V1 and V2. I've tried it on a 12 year-old Windows 10 PC and a new Windows 11 PC. I know I can use Sleep statements to slow the output down and this works though it's obviously longer to code. Only the AHK script shown above is active and I've exited Windows PowerToys and TypingAid in case they might be affecting things.

So, how can I slow Send characters down?

NB This is a simple example to demonstrate the problem. I want to use AHK in other programs to send a more complicated series of characters eg Google Sheets to move the cursor and copy and paste cells.

I look forward to getting your advice and suggestions.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: SetKeyDelay not slowing Send output - Autohotkey v2.0.2  Topic is solved

Post by swagfag » 07 Feb 2023, 12:37

the green box in this section https://www.autohotkey.com/docs/v2/lib/Send.htm#SendInputDetail

SendInput is the new default in v2. u need to use Event or Play instead, for any delays to take effect

want2learn
Posts: 2
Joined: 07 Feb 2023, 10:37

Re: SetKeyDelay not slowing Send output - Autohotkey v2.0.2

Post by want2learn » 07 Feb 2023, 14:21

Hi swagfag

I tried it with SendEvent and it works as you suggested.

Many thanks for your help.

Post Reply

Return to “Ask for Help (v2)”