Page 1 of 1

Prevent triggering and buffering

Posted: 12 Oct 2020, 03:53
by stretch65
Say I have 2 hot keys defined. For example:

Code: Select all

$m:: {
  keywait "m"
}

$a:: {
  keywait "a"
}
If I hold down "m" then $m:: is obviously triggered. If, while I'm holding "m" down, I press "a" then $a:: interrupts $m:: . When "a" is released, $m:: resumes until it's released as well.
Now what I want is for the script to totally ignore $a:: while I'm holding down "m". In other words, I don't want it triggered OR buffered. How would I do that?

I've tried increasing the thread priority inside of $m::, but $a:: still triggers, so I'm not sure what to do.

Re: Prevent triggering and buffering

Posted: 12 Oct 2020, 06:21
by boiler
Make the a hotkey conditional on the state of the m key using #HotIf:

Code: Select all

$m:: {
  keywait "m"
}

#HotIf !GetKeyState("m", "P")
$a:: {
  keywait "a"
}