Code: Select all
#SingleInstance FORCE
SetTitleMatchMode Regex
#Persistent
SendMode Input
DetectHiddenWindows, On
#IfWinActive ahk_class ((Warcraft III)|(OsWindow)|(Qt5QWindowIcon))
Tab & LButton::
KeyWait, Tab
KeyWait, LButton
BlockInput, On
SendInput, +{LButton}
Sleep, 200
SendInput, ^1 ;line Z
Sleep, 200 ;line X
SendInput, {LButton} ;line Y
BlockInput, Off
return
However, if the line X is set to 200ms or less, the behavior of the line Y will be very strange, acting like sending the CTRL+LBUTTON as if the CTRL of the line Z has not been released.
I've never met this issue before, maybe this is a defect of warcraft.exe? I don't know and not sure. However, the problem is still the problem which needs to be solved, and manually simulating keys input as fast as I can did not have this problem, and only script simulation will encounter this issue.
I tried to add between line X and Y:
Code: Select all
SendInput, {Ctrl Up}
Code: Select all
KeyWait, Ctrl, T3