Send Key Time Sequence

Post your working scripts, libraries and tools for AHK v1.1 and older
william_ahk
Posts: 470
Joined: 03 Dec 2018, 20:02

Send Key Time Sequence

Post by william_ahk » 01 Aug 2021, 23:56

Code: Select all

#NoEnv
#SingleInstance Force
keys_timeline := [["o", 1], ["r", 100], ["e", 1000], ["o", 200]]
return

$o::
start := A_TickCount
t_index := 1
while (GetKeyState("o", "P")) {
    elapsed := A_TickCount - start
    if (elapsed > keys_timeline[t_index][2]) {
        start := A_TickCount
        if (t_index < keys_timeline.length()) {
            t_index++
        } else {
            Send % keys_timeline[keys_timeline.MaxIndex()][1]
        }
    } else {
        Send % keys_timeline[t_index][1]
    }
}
return
orrrrrrreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeoooooooooooooooooooooooooooooooo
orrrrrrreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeoooooo

Return to “Scripts and Functions (v1)”