How to exempt a key from suspension? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
racer
Posts: 29
Joined: 07 May 2022, 15:02

How to exempt a key from suspension?

Post by racer » 22 May 2022, 19:57

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
Last edited by racer on 22 May 2022, 20:20, edited 2 times in total.

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: How to exempt a key from suspension?

Post by boiler » 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.

racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: How to exempt a key from suspension?

Post by racer » 22 May 2022, 20:20

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?

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

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

Post by mikeyww » 22 May 2022, 20:45

Approach already explained in your other post.

Code: Select all

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

racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: How to exempt a key from suspension?

Post by racer » 22 May 2022, 20:54

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.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: How to exempt a key from suspension?

Post by mikeyww » 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.

racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: How to exempt a key from suspension?

Post by racer » 23 May 2022, 09:55

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

Post Reply

Return to “Ask for Help (v1)”