Delay between continuous keypresses? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

Delay between continuous keypresses?

22 Jul 2021, 21:51

I want to press End 100 times, with 1 second in between keypresses.

Setkeydelay doesn't work with Sendinput or Send.

I also want to implement key delay only for this line (instead of the entire script). How can I do it?
Ianizer
Posts: 79
Joined: 07 Mar 2021, 00:06

Re: Delay between continuous keypresses?

22 Jul 2021, 22:48

I personally would just work around the problem:

Code: Select all

Loop, 100
{
Send, {End}
Sleep, 1000
}
But I bet there's a fewer-line-consuming way somewhere, I just wouldn't know it because I have a very "spotty" AHK education/I started seriously learning AHK about four months ago.
Rohwedder
Posts: 7627
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Delay between continuous keypresses?  Topic is solved

23 Jul 2021, 01:07

Hallo,
with a Timer:

Code: Select all

$End Up::SetTimer, TEnd,% 10*TEnd:=100
TEnd:
Send, {End}
SetTimer,,% --TEnd?"On":"Off"
Return
Hotkey line alternative:

Code: Select all

$End Up::SetTimer, TEnd, 1000,% TEnd:=100
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

Re: Delay between continuous keypresses?

23 Jul 2021, 19:50

Thank you! I'm using this in conjunction with an auto-paging script on Chrome. Is there a function on ahk I can use to detect the end of a webpage, so it will stop scrolling to the end/break script?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Mannaia666 and 408 guests