Reset a subset of maps without pausing/stopping script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mjbatty
Posts: 19
Joined: 05 Nov 2020, 08:50

Reset a subset of maps without pausing/stopping script

Post by mjbatty » 02 Dec 2022, 09:10

Is there a way to reset a mapping to it's unmapped state without pausing or stopping the script?

This relates to an earlier post, here for ref: viewtopic.php?p=493931

I want to effectively remove any mapping in effect but only for a number of keys while still keeping the mappings for several others.


mjbatty
Posts: 19
Joined: 05 Nov 2020, 08:50

Re: Reset a subset of maps without pausing/stopping script

Post by mjbatty » 02 Dec 2022, 10:13

Thanks @mikeyww

I tried that but it had no effect, also tried the following which seemed to disable the key rather than remove the current mapping:

Code: Select all

PgUp::
PgDn::
Home::
End::

mjbatty
Posts: 19
Joined: 05 Nov 2020, 08:50

Re: Reset a subset of maps without pausing/stopping script

Post by mjbatty » 02 Dec 2022, 10:16

Actually, I was hoping to avoid the extra typing, but your reply got me thinking and the following does seem to work:

Code: Select all

	PgUp::send {PgUp}
	PgDn::send {PgDn}
	Home::send {Home}
	End::send {End}

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

Re: Reset a subset of maps without pausing/stopping script

Post by mikeyww » 02 Dec 2022, 12:50

OK, but if you use #If to define a context, then when no such context applies, the hotkey will do whatever it normally does without the script. That makes things easier.

mjbatty
Posts: 19
Joined: 05 Nov 2020, 08:50

Re: Reset a subset of maps without pausing/stopping script

Post by mjbatty » 08 Dec 2022, 11:42

Thanks @mikeyww

Sorry it took so long to reply, Covid and Flu took me down for a while.

I thought I tried that and it didn't work, seemed like it remembered the last setting; however after testing again today it does work as you described.

I *think* I may have had two copies of the same script (slightly different names) running at the same time before.

As always, appreciate the help of you and everyone, thanks.

Post Reply

Return to “Ask for Help (v1)”