Sorry for my english
I need a script to do something like this...
Tap A and B at the same time will output C and only C ,C will keep the holding state when A and B are both still pressed down until one of them are released.
A/B will only wait for the other to be pressed down for 15ms, longer than that will not output C , just output A/B normally in-between.
A and B will function normally like the others keys (hold, up, down) , until triggered.
I hope someone can answer this , this sound easy but bother me for a long time... thks
Press two keys for one hotkey
Re: Press two keys for one hotkey
Hallo,
try:If the key C should do AutoRepeat it would still need a corresponding Timer.
try:
Code: Select all
Ta := Tb := 0
#IF !GetKeyState("c")
$*a::
$*b::
AB := SubStr(A_ThisHotkey,0), T%AB% := A_TickCount
SetTimer, AB, -15
Return
AB:
Send,% "{Blind}{" (Abs(Ta-Tb)<15?"c Down}":AB " Down}")
Return
#IF GetKeyState("c")
*a Up::
*b Up::Send, {Blind}{a Up}{b Up}{c Up}
#IF
~*a Up::
~*b Up::Return
Re: Press two keys for one hotkey
Sorry for the later reply, the site doesn't give me any notification...
Another ahk people send me a script that almost solved my question
https://www.autohotkey.com/board/topic/40874-chording-script/
This one gave me the best result so far ,the game will understand all the output like normal, every keys state are correct, but it share the same pass through error with your script.
Which is when you hold a/b long enough then press the other key, c will be outputted. That is incorrect , because the pressing time is already over 15ms. If you know how to fixed his script plz let me know![Smile :)](./images/smilies/icon_e_smile.gif)
Anyway, thks.
Another ahk people send me a script that almost solved my question
https://www.autohotkey.com/board/topic/40874-chording-script/
This one gave me the best result so far ,the game will understand all the output like normal, every keys state are correct, but it share the same pass through error with your script.
Which is when you hold a/b long enough then press the other key, c will be outputted. That is incorrect , because the pressing time is already over 15ms. If you know how to fixed his script plz let me know
![Smile :)](./images/smilies/icon_e_smile.gif)
Anyway, thks.