How to use "Suspend, Permit" with single line subroutines? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
eduardobedoya
Posts: 45
Joined: 05 May 2016, 14:02

How to use "Suspend, Permit" with single line subroutines?

11 May 2018, 18:26

Hi, I'm using "Suspend, Permit" as the first line in some subrouts, in order to let them be enabled when the AHK script is suspended

but I wonder how to achieve the same with single line subroutines? eg.

Code: Select all

#Tab::#^+!Right
How can I make this subrout above to work even when the AHK script is suspended? convert this "single line subroutine" into a "multiple lines subroutine" is not an option
cuz I use them in some cases in which using different lines to "Send" or "SendInput" don't get the same result.

Thanks Advanced.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 02:27

Hello :wave: .
In v2, you can use #suspendExempt. Eg,

Code: Select all

#suspendExempt true
a::b
It seems it was not added to v1. You have to use a multiline subroutine I guess.

Cheers.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to use "Suspend, Permit" with single line subroutines?  Topic is solved

12 May 2018, 02:28

Hallo,
this multiline subroutine is exactly what you want:
(check it with ListLines)

Code: Select all

*#Tab::
Suspend, Permit
SetKeyDelay,-1
Send,{Blind}#^+!{Right DownR}
Return
*#Tab Up::
Suspend, Permit
SetKeyDelay,-1
Send,{Blind}{Right Up}
Return
eduardobedoya
Posts: 45
Joined: 05 May 2016, 14:02

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 07:04

Hi Helgef I use v1.14, (AutohotkeyL) are there too many differences between this an v2? I'm worried about the backward compatibility. I have a 20000 lines script, n read that most scripts writen on v1 should be changed in order to work in v2. btw, can now AHKv2 handle the windows 8.1 alt tab (Task Switcher)?
thx advanced.

thanks Rohwedder I think I would have to avoid writing subrouts of just one line.
Last edited by eduardobedoya on 12 May 2018, 12:14, edited 1 time in total.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 07:52

I wouldn't convert massive scripts to v2 only for the purpose of using #suspendExempt.
can now AHKv2 handle the windows 8.1 alt tab (Task Switcher)?
I do not know. You can read about v2 here.

Good luck.
eduardobedoya
Posts: 45
Joined: 05 May 2016, 14:02

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 08:08

yeah I thought the same, isn't there any other way to do the "Suspend, Permit" with single line subrouts in AHK vanilla? thx advanced.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 14:14

Hallo,
just put all subroutines which should not be suspended into a second script.
If this script is not supended, they remain active.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: How to use "Suspend, Permit" with single line subroutines?

12 May 2018, 18:07

eduardobedoya wrote:btw, can now AHKv2 handle the windows 8.1 alt tab (Task Switcher)?
v2 does not handle alt-tab any differently to v1. IIRC, Windows 8 blocks programs from simulating keyboard shortcuts which can exit "immersive mode", such as alt-tab and win-D. See How do I work around problems caused by User Account Control (UAC)? and Run with UI Access.

There is no v1.14. There is v1.1.14, which is outdated. You should probably update to v1.1.28.02.
eduardobedoya
Posts: 45
Joined: 05 May 2016, 14:02

Re: How to use "Suspend, Permit" with single line subroutines?

24 May 2018, 07:48

Hi, lexicos, thanks for your reply,
Now I have another reason to run my AHKscript with UI Access, (besides it enables the BlockInput)
please lexicos do you have a script that could perform "Windows Alt Tab" exactly as Windows 8.1 does, n using the same hotkeys "Alt Tab" n "Shift Alt Tab"
I need to do that, cuz in my script, I use extensively "Key Tab" as a modifier key (eg. Tab & a::) so my "Key Tab" native function got disabled, hence my "Alt Tab" doesn't work.
I read the manual, but it offers strange hotkeys to perform "Windows Alt Tab" I just would like to renable the hotkeys of Windows 8.1 "Alt Tab" n "Shift Alt Tab".
should I make another post for this question? many thanks advanced.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 260 guests