C
C
cataclysm882021-05-22 13:16:32
autohotkey
cataclysm88, 2021-05-22 13:16:32

How to make a keypress in AutoHotKey for a certain amount of time?

Let's say I have code:

F1::
{
Send, {sc11}
}

He presses the W button (sc11 is the scan for the W key).
How to make the W button not just pressed once, but held for a certain amount of time. For example, 6 seconds.
Well, that is, you press F1, and the W key is held for 6 seconds and then released.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
a1987zz, 2021-05-26
@a1987zz

If you don't bother at all:

F1::
Loop
{
send W
if A_Index = 1000
break
}
return

Instead of A_Index, you need to use the current time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question