Ok my code has the following which works:
^m::Send M text{enter}
Return
^s::Send S text{enter}
Return
^t::Send T text{enter}
Return
Now I want to be able to add something like the following (this way it doesn't work):
^m & ^t:: Send M and T text{enter}
Return
^m & ^s:: Send M and S text{enter}
Return
^t & ^s:: Send T and S text{enter}
Return
I want AHK to take all three sequences like Ctrl + S does one thing and Ctrl + M does another but Ctrl + S + M does a different third action.
There is a similar post to this here: AutoHotKey key SEQUENCE, not just single-key hotkey
If you don't find a fitting solution, you might want to try the workaround which I've been using.
Note: the following does not include any hotkey triggers like ^m::
, the problem is being solved with the hotkey -command and fitting label names, which actually look like a hotkey trigger ( ^m:
)
hotkey, ^m, ^m, On
hotkey, ^t, ^m, On
return
^m_and_^t: ; will also be called from ^t & ^m
Send M and T text{enter}
triggered = true
return
^m_and_^s:
Send M and S text{enter}
triggered = true
return
^t_and_^s:
Send T and S text {enter}
triggered = true
return
^m:
triggered = false
hotkey, ^t, ^m_and_^t, On
hotkey, ^s, ^m_and_^s, On
loop
{
getkeystate, isDown, m, P
if isDown = U
break
}
hotkey, ^t, ^t, On
hotkey, ^s, ^m_and_^s, Off ; -> ^s will keep its natural function
if triggered = false
{
Send M text{enter}
}
return
^t:
triggered = false
hotkey, ^s, ^t_and_^s, On
hotkey, ^m, ^m_and_^t, On
loop
{
getkeystate, isDown, t, P
if isDown = U
break
}
hotkey, ^m, ^m, On
hotkey, ^s, ^m_and_^s, Off ; -> ^s will keep its natural function
if triggered = false
{
Send T text{enter}
}
return
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.