I am trying to set tapping and double tapping on LAlt key to trigger different functions. My single tap function is like below:
Code: Select all
~LAlt::
; If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 400)
; {
; sendinput, {NumpadDiv} ;double tapping function
; }
sendinput, {Numpad2}{Home Down} ;single tapping function
keywait, LAlt
sendinput, {End down}{Home Up} ;single tapping function
sleep 500
sendinput, {End up}
}
Return
This code doesnt work because the "sleep 500" command near the end of the code will make the time between two LAlt key presses greater than 500, thus that "less than 400" condition is never met.
Even I lessen the condition to be for example 600, it still won't work in fast double tapping scenario, since less than 500 mil seconds fast double tapping will still be blocked by that "sleep 500" command.
Can anyone teach me to kick of a thread where double tapping evaluation is done in a paralle thread? Or teach me a way to start a parallel processing thread on that "sleep 500" command so it won't block another fast LAlt press?
Thanks!