In the code below the 'w' key is pressed twice in a certain amount of time to trigger a games native auto run feature with a hotkey. However, to sprint the 'shift' key must be held down so this hotkey also sends a 'LShift Down' indefinitely until it is broken. When the hotkey Xbutton1 fires to send 'm' the previous hotkey no longer is continuing with 'LShift Down'.
What I have read so far is that ' AutoHotkey is not a "multitasking" app ', that the hotkey is being put on hold, and that maybe using some run command may help? Or maybe creating multiple ahk scripts? Not sure how to proceed.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
RCtrl & SC50:: ;2 auto sprint (rctrl & numpad2)
Send {w down}
Sleep 50
Send {w up}
Sleep 50
Send {w down}
Sleep 50
Send {w up}
Send {LShift Down}
return
XButton1::m ;4 map