This code sends '1' when I press and hold the '1' key for less than 0.3 seconds, and '!' if held for more than 0.3 s.
Code: Select all
$1::
keyWait 1 , T0.3
if !ErrorLevel
send {1}
else send {!}
keyWait 1
return
This works as expected. However, if I press any other key in a quick succession
after a short-press '1', for example '2', then my computer registers it as '21' instead of '12'.
How to fix this?
Edit: Using 'Critical' before the first 'keywait' helps with the short-press issue but causes multiple '!' when long-pressing '1'.