Page 1 of 1

How to exempt a key from suspension?

Posted: 22 May 2022, 19:57
by racer
Hello guys,
This code suspends all hotkeys but I would like Tab to be an exception.

Code: Select all

~LButton::
Suspend, Permit
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200)
 Suspend
Return
I tried this one but there is something wrong
https://lexikos.github.io/v2/docs/commands/_SuspendExempt.htm

Re: How to exempt a key from suspension?

Posted: 22 May 2022, 20:15
by boiler
racer wrote: I tried this one but there is something wrong
https://lexikos.github.io/v2/docs/commands/_SuspendExempt.htm
The thing that’s wrong is that you found that in the documentation for the AHK v2 beta release, and you are not using that version of AHK. Or if you are, the code you posted is not correct v2 syntax.

Re: How to exempt a key from suspension?

Posted: 22 May 2022, 20:20
by racer
boiler wrote:
22 May 2022, 20:15
racer wrote: I tried this one but there is something wrong
https://lexikos.github.io/v2/docs/commands/_SuspendExempt.htm
The thing that’s wrong is that you found that in the documentation for the AHK v2 beta release, and you are not using that version of AHK. Or if you are, the code you posted is not correct v2 syntax.
Yes, I found out that it is an old approach to exempt a hotkey. Is there any other way to do that?

Re: How to exempt a key from suspension?  Topic is solved

Posted: 22 May 2022, 20:45
by mikeyww
Approach already explained in your other post.

Code: Select all

~Tab::Suspend, Permit
Explained: viewtopic.php?p=463632#p463632

Re: How to exempt a key from suspension?

Posted: 22 May 2022, 20:54
by racer
mikeyww wrote:
22 May 2022, 20:45
Approach already explained in your other post.

Code: Select all

~Tab::Suspend, Permit
Explained: viewtopic.php?p=463632#p463632
I didn't actually know that I could put the Tab before the Suspend, Permit. Now there is another issue. I have actually assigned the Tab for an action. It says duplicate hotkey.

Re: How to exempt a key from suspension?

Posted: 23 May 2022, 03:22
by mikeyww
A third time then: in your other hotkey definition for Tab, use Suspend, Permit as the first line. You can then delete your newer duplicate. The quote from the documentation is copied again below.
Any hotkey/hotstring subroutine whose very first line is Suspend (except Suspend On) will be exempt from suspension.

Re: How to exempt a key from suspension?

Posted: 23 May 2022, 09:55
by racer
mikeyww wrote:
23 May 2022, 03:22
A third time then: in your other hotkey definition for Tab, use Suspend, Permit as the first line. You can then delete your newer duplicate. The quote from the documentation is copied again below.
Any hotkey/hotstring subroutine whose very first line is Suspend (except Suspend On) will be exempt from suspension.
I did it from the beginning, but it didn't work. It was due the conflicts of scripts. Thank you