Schulz
Schulz

Reputation: 3

Toggle holding 2 keys at the same time - slow speed

I am using Autohotkey to hold down 2 keys at the same time, when doing it by hand it is much faster then my code. Did I make a mistake?

If it was unclear what I ment, I recorded it in a short clip, first one is by hand, second with the script

F7::
SetKeyDelay, 0
Toggle := !Toggle
If (Toggle)
    Send {1 down}{2 down}
Else
    Send {1 up}{2 up}
Return

Upvotes: 0

Views: 1632

Answers (2)

Eirik Rindal
Eirik Rindal

Reputation: 81

#maxThreadsPerHotkey, 2
setKeyDelay, 50, 50
setMouseDelay, 50
banana:=0

$F7::
banana:=!banana
    while (banana=1)
    {
        send, {1}{2}
        sleep, 100
    }
Return

esc::ExitApp

From this tread:

Autofire and togle

Upvotes: 1

Robert Ilbrink
Robert Ilbrink

Reputation: 7973

I'm not sure what you want to do. This script seems to press and hold down 1 and 2, until you press F7 again and both keys are released again. Is that what you wanted?

Upvotes: 0

Related Questions