AHK - Autohotkey mutli key trigger functions
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I am trying to get an AHK function to work and looking for help here.

for the purpose of the bounty i would like to be able to trigger opening a notepad instance if I hit

Ctrl+Alt+Shift (at the same time) then 1, pause,2 pause, 3

then if i do

Ctrl+Alt+Shift (at the same time) then 1,pause,2 pause, 4

I open and cmd prompt

Am on windows 10 on AHK 1.1.31.01

Can you please answer a couple of questions? 1. When do you release Ctrl-Alt-Shift: before 1, after 1 or after 3/4? 2. "Pause" is not the name of the key, right?
TheOsch 17 days ago
Hi Qdev, You went mute on this... any updates?
mashtullah 13 days ago
Hi Qdev, let me know incase you have any more changes needed, the bounty is about to expire...
mashtullah 11 days ago
awarded to mashtullah

Crowdsource coding tasks.

1 Solution

Winning solution

Here is the solution to your problem, the code below opens notepad after a hotkey of Ctrl+Alt+Shift release then type 1 pause then 2 pause then 3 or 4 the maximum interval between the inputs is 5 seconds, you can change the parameter T5 to T wherever(in seconds)

~^!Shift::
Input, UserInput, T5 L3 , 123,124
if (ErrorLevel = "Timeout")
{
MsgBox, You entered "%UserInput%" at which time the input timed out.
return
}
if (ErrorLevel = "NewInput")
return
If InStr(ErrorLevel, "EndKey:")
{
MsgBox, You entered "%UserInput%" and terminated the input with %ErrorLevel%.
return
}

if (UserInput = "123")
Run, notepad

if (UserInput = "124")
Run, cmd
return

You can also however remove all the error handling and just have the code shortened to

~^!Shift::
Input, UserInput, T5 L3 , 123,124
if (UserInput = "123")
Run, notepad
if (UserInput = "124")
Run, cmd
return

Incase of any queries on the above code let me know

NB Tested on Windows 10 64 bit

Hey this is great - I’ll test in just a bit
Qdev 17 days ago
You are welcome, let me know how it goes...
mashtullah 17 days ago
Did you test this? Any feedback? If it's ok then award the bounty...
mashtullah 15 days ago
hey sorry for the delay, will test today
Qdev 10 days ago
Its ok, thanks, incase of any changes let me know...
mashtullah 10 days ago