Press different keys every X seconds

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NightLord
Posts: 2
Joined: 19 Aug 2018, 02:44

Press different keys every X seconds

19 Aug 2018, 02:53

Hi all, sorry but I can't find a solution with the search.
I need to:
press key "a" every ... seconds
press key "b" every ... seconds
and so on.
is there a solution?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Press different keys every X seconds

19 Aug 2018, 04:18

Code: Select all

createTimer("a", 1000)
createTimer("b", 500)

createTimer(key, period) {
	fn := Func("sendKey").Bind(key)
	SetTimer % fn, % period
}

sendKey(key) {
	Send % key
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: hiahkforum, mikeyww and 223 guests