Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Re: How to ISOLATE single and double keypresses?

$
0
0
Hi again.
Lately noticed weird behavior of longpress (Keywait) code parts. When I use short/long with regular letter keys everything works fine.
But If I use it with Escape, Enter, arrows or even ctrl/alt/shift, then in 75% of cases (or more) it gets stuck with long press blocking next single presses or other keys to be registered.
Is there a solution for that?

Here are sample blocks from my script for "Esc" and "e" keys. They look the same but works differently.
The most likely scenarios with escape are:
a) the second press even after a minute calls long press and blocks input.
b) works fine with a few single presses but after a long press blocks input.

CODE:

Esc::{
waitvar := (Keywait(A_ThisHotkey, "T" longpress))
if waitvar
Send '{Blind}^!+{VKC0}'
else
Send '{Blind}^!+{F12}'
KeyWait A_ThisHotkey ; stops key repeat from retriggering
}

e::{
waitvar := (Keywait(A_ThisHotkey, "T" longpress))
if waitvar
Send '{Blind}^{VK47}'
else
Send '{Blind}!{VK47}'
KeyWait A_ThisHotkey ; stops key repeat from retriggering
}


Any ideas?

Statistics: Posted by alphaomega — Today, 16:53



Viewing all articles
Browse latest Browse all 579

Trending Articles