Hello,
Trying to write a script that will perform different commands each time it is pressed. I've found a couple examples here, but none are really what I'm after.
Toggle would work if it was just two, but it's more like four to six.
Basically:
^a:: ;specifically, holding down CTRL the entire time, but pressing A more than once
(if pressed once)
send chicken
return
(if pressed twice quickly)
send duck
return
(if pressed 3x quickly)
send cow
return
(if pressed 4x quickly)
send horse
return
One shortcut, different commands on X number of times pressed.
-
- Posts: 43
- Joined: 20 Apr 2020, 14:29
Re: One shortcut, different commands on X number of times pressed.
Code: Select all
^a::n++
~Ctrl Up::
SendInput % ["chicken", "duck", "cow", "horse"][n]
n =
Return
-
- Posts: 43
- Joined: 20 Apr 2020, 14:29
Re: One shortcut, different commands on X number of times pressed.
Thanks. I got it the way I wanted while this post was in moderation:mikeyww wrote: ↑06 Dec 2022, 16:14Code: Select all
^a::n++ ~Ctrl Up:: SendInput % ["chicken", "duck", "cow", "horse"][n] n = Return
Code: Select all
#IfWinActive, ahk_exe explorer++.exe
insert::
count++
If count=1
{
send !v
send o
send {down 3}
send {enter}
send {end}
}
If count=2
{
send !v
send o
send {down 3}
send {enter}
send {end}
}
If count=3
{
send !v
send o
send {down 2}
send {enter}
send {end}
}
If count=4
{
send !v
send o
send {down 2}
send {enter}
send {end}
}
If count=5
{
send !v
send o
send {down 1}
send {enter}
send {end}
}
If count=6
{
send !v
send o
send {down 1}
send {enter}
send {end}
}
If count=7
{
send !v
send o
send {enter}
send {end}
}
If count=8
{
send !v
send o
send {enter}
send {end}
count:=0
}