stuck with priorkey
stuck with priorkey
I would like my script to press the numpad enter button if the previous key was escape & within the past 2 seconds
this is what I got so far, it currently works for the enter key, I did not manage to set it to the escape key.
Enter::
If (A_TimeSincePriorHotkey < 2000 and A_TimeSincePriorHotkey !=-1)
Send, {NumpadEnter}
else
return
any help is appreciated
- AlphaBravo
- Posts: 586
- Joined: 29 Sep 2013, 22:59
Re: stuck with priorkey
Code: Select all
esc::
EscVar := 1
SetTimer, EscVar, -2000
return
EscVar:
EscVar := 0
return
#if EscVar
Enter::
Send, {NumpadEnter}
EscVar := 0 ; optional line to terminate the 2-second window
return
#if
Re: stuck with priorkey
Heya, thanks for your post! I'm not sure what your script does tho? Doesn't seem to be what I'm looking forAlphaBravo wrote:Code: Select all
esc:: EscVar := 1 SetTimer, EscVar, -2000 return EscVar: EscVar := 0 return #if EscVar Enter:: Send, {NumpadEnter} EscVar := 0 ; optional line to terminate the 2-second window return #if
I want the enter key to ONLY function if the escape key was pressed in the past two seconds.
Also, is it possible to maintain the original purpose of my escape key while getting a script for this?
- AlphaBravo
- Posts: 586
- Joined: 29 Sep 2013, 22:59
Re: stuck with priorkey
modified it to :
enter key to ONLY function if the escape key was pressed in the past two seconds, maintain the original purpose of my escape.
enter key to ONLY function if the escape key was pressed in the past two seconds, maintain the original purpose of my escape.
Code: Select all
~esc::
EscVar := 1
SetTimer, EscVar, -2000
return
EscVar:
EscVar := 0
return
Enter::
if !EscVar
return
Send, {NumpadEnter}
EscVar := 0 ; optional line to terminate the 2-second window
return
Re: stuck with priorkey
sir, I am so grateful for your help
Re: stuck with priorkey
I messed around a bit with it but I failed to add one more thing I need.
I kinda feel bad for requesting your assistance once more, but is it possible to have this AND make the enter function work if left mouse button was double pressed, past 2 seconds?
I kinda feel bad for requesting your assistance once more, but is it possible to have this AND make the enter function work if left mouse button was double pressed, past 2 seconds?
- AlphaBravo
- Posts: 586
- Joined: 29 Sep 2013, 22:59
Re: stuck with priorkey
add the following :
Code: Select all
~LButton::
if (A_ThisHotkey = A_PriorHotkey) && (A_TimeSincePriorHotkey < 300)
{
EscVar := 1
SetTimer, EscVar, -2000
}
return
Re: stuck with priorkey
you're my hero lol
Who is online
Users browsing this forum: Google [Bot], RandomBoy and 243 guests