Borderlands 2 is not installed here, so I tested the logical key states in a Notepad window. Are there any differences?
Please use in the description instead of sprinting and ADS key states e.g. W=down + Shift=down.
Code: Select all
SetTimer,State,200,Keys:="w Shift LButton RButton"
State: ;Keys separated with space or tab
For all,Key in StrSplit(Keys,[A_Space,A_Tab])
Text.=Trim(Key)>""?"`n" Key "`t" (GetKeyState(Key)?"down":"up"):
MouseGetPos, MX, MY ;separated from another ToolTip
ToolTip,% SubStr(Text,2),MX+16,MY+32,4,Text:=""
Return
#If (WinActive("Borderlands 2") Or WinActive("ahk_class Notepad"))
And !GetKeyState("LButton","P") And !GetKeyState("RButton","P")
*w::Send, {Shift down}{w down}
*w Up::Send, {Shift up}{w up}
#If (WinActive("Borderlands 2") Or WinActive("ahk_class Notepad"))
And GetKeyState("w","P")
*LButton::Send, {Shift Up}{LButton Down}
*LButton Up::Send, {LButton Up}{Shift down}
*RButton::Send, {Shift Up}{RButton Down}
*RButton Up::Send, {RButton Up}{Shift down}
#If