suspend keys of another script Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jekko1976
Posts: 97
Joined: 10 Oct 2014, 07:03

suspend keys of another script

03 Nov 2023, 10:15

Hello,
I have a script always working in the background.
This script has the key ctrl+shift+p that launch a procedure that "does something".
I need to run ANOTHER SCRIPT that to launch a print needs to send LITERLALLY the keys ctrl+shift+p.
But when I set this second script to send the keys ctrl+shift+p, the other script in background start to "do what he have to do" and the keys are not sended.
How could I command autohotkey to suspend EVERY ahk hotkeys of EVERY script for the while that I send ctrl+shift+p? "Hotkeys off" and "suspend" doesn't work because these command are relative only to the script where are inserted.

otherwise

How could I command autohotkey to send LITERALLY ctrl+shift+p instead of triggering the other script?

Thank you so much
Rohwedder
Posts: 7656
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: suspend keys of another script  Topic is solved

03 Nov 2023, 10:53

Hallo,
try:

Code: Select all

q:: ; On/Off Suspend and Pause all other scripts
DetectHiddenWindows, On
WinGet, AHKList, List, ahk_class AutoHotkey
Loop, %AHKList%
{
    ID := AHKList%A_Index%
    If (ID = A_ScriptHwnd)
        Continue
    PostMessage, 0x111, 65305,,, ahk_id %ID% ; Suspend, Toggle
    PostMessage, 0x111, 65306,,, ahk_id %ID% ; Pause, Toggle
}
Return
jekko1976
Posts: 97
Joined: 10 Oct 2014, 07:03

Re: suspend keys of another script

06 Nov 2023, 02:30

@Rohwedder
Thank you very much!
Your solution works perfectly!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], peter_ahk and 95 guests