How to pause other hotkeys/hotstrings

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
larabee
Posts: 8
Joined: 06 Aug 2018, 16:06

How to pause other hotkeys/hotstrings

13 Aug 2018, 00:48

I need to prevent my script from working for a short while. Is there a command that prevents the other hotkeys from firing while my script does it's work?

In fact I want my active window to STAY active while I'm sending commands to it (I have other script sequences that changes the active window). Changing the active window can result in sending to "wrong" window with unpredictable consequences). ControlSend does not work with my game, unfortunately.

I assume that there is no command to keep one window active, so I thought that I would force the other scripts to "sleep" for a very short while, or...?

Anyone, please? Thank you.
TigerYT
Posts: 24
Joined: 13 Aug 2018, 01:01

Re: How to pause other hotkeys/hotstrings

13 Aug 2018, 01:05

You'd have to make another script and then send a pause command to the other script you want to be paused.

Code: Select all

DetectHiddenWindows, On
WM_COMMAND := 0x111
ID_FILE_PAUSE := 65403
PostMessage, WM_COMMAND, ID_FILE_PAUSE,,, C:\ScriptToBePaused.ahk ahk_class AutoHotkey
larabee
Posts: 8
Joined: 06 Aug 2018, 16:06

Re: How to pause other hotkeys/hotstrings

17 Aug 2018, 03:34

OK, thank you very much for your kind suggestion.

However, that solves only part of my problem since I also need to turn the script on. Like commands
gosub TurnTheDarnedScriptOff
... various commands ...
gosub TurnTheDarnedScriptOn.

Do you - or anyone - happen to know how to turn the script back on?

Thank you.
ahklearner
Posts: 313
Joined: 23 Jan 2015, 01:49

Re: How to pause other hotkeys/hotstrings

17 Aug 2018, 08:23

In case of suspend ? What to use instead of this ?
WM_COMMAND := 0x111
ID_FILE_PAUSE := 65403

thanks in advance
ahklearner
Posts: 313
Joined: 23 Jan 2015, 01:49

Re: How to pause other hotkeys/hotstrings

17 Aug 2018, 08:25

this works as toggle
larabee wrote:OK, thank you very much for your kind suggestion.

However, that solves only part of my problem since I also need to turn the script on. Like commands
gosub TurnTheDarnedScriptOff
... various commands ...
gosub TurnTheDarnedScriptOn.

Do you - or anyone - happen to know how to turn the script back on?

Thank you.
ahklearner
Posts: 313
Joined: 23 Jan 2015, 01:49

Re: How to pause other hotkeys/hotstrings

17 Aug 2018, 08:27

https://autohotkey.com/boards/viewtopic.php?t=27824

IDs 65300-65307 and IDs 65400-65413:

ID_TRAY_OPEN := 65300
ID_FILE_RELOADSCRIPT := 65400 ;ID_TRAY_RELOADSCRIPT := 65303
ID_FILE_EDITSCRIPT := 65401 ;ID_TRAY_EDITSCRIPT := 65304
ID_FILE_WINDOWSPY := 65402 ;ID_TRAY_WINDOWSPY := 65302
ID_FILE_PAUSE := 65403 ;ID_TRAY_PAUSE := 65306
ID_FILE_SUSPEND := 65404 ;ID_TRAY_SUSPEND := 65305
ID_FILE_EXIT := 65405 ;ID_TRAY_EXIT := 65307
ID_VIEW_LINES := 65406
ID_VIEW_VARIABLES := 65407
ID_VIEW_HOTKEYS := 65408
ID_VIEW_KEYHISTORY := 65409
ID_VIEW_REFRESH := 65410
ID_HELP_USERMANUAL := 65411 ;ID_TRAY_HELP := 65301
ID_HELP_WEBSITE := 65412


ahklearner wrote:In case of suspend ? What to use instead of this ?
WM_COMMAND := 0x111
ID_FILE_PAUSE := 65403

thanks in advance

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: haomingchen1998, mikeyww, mmflume, roysubs, scriptor2016, ShatterCoder and 103 guests