Search code examples
toggleautohotkeydelay

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

Solution

  • #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