How to disable a hotkey of a background software?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NorInd
Posts: 43
Joined: 03 May 2020, 04:23

How to disable a hotkey of a background software?

22 Apr 2021, 19:52

Question::
How to disable a hotkey of a background software?

Situation::
I have a communication (voice chat) software, called "AA.exe".
It runs at background. It mutes itself when I am pressing down "ctrl".
But I want to use "ctrl", while preventing it from muting itself.
So, I want to block "ctrl" just for it.

Attempt::
I was thinking about using::

Code: Select all

#IfWinActive, ahk_exe AA.exe

Ctrl:: return

#IfWinActive
But I don't think it will work when its running at background.
User avatar
mikeyww
Posts: 26933
Joined: 09 Sep 2014, 18:38

Re: How to disable a hotkey of a background software?

22 Apr 2021, 20:03

Code: Select all

#IfWinExist ahk_exe AA.exe
Ctrl::MsgBox, No muting here!
#IfWinExist
It does not restore the native function, but enables Ctrl to do something different.
User avatar
rommmcek
Posts: 1475
Joined: 15 Aug 2014, 15:18

Re: How to disable a hotkey of a background software?

22 Apr 2021, 21:34

If the Ctrl has a toggle functionality you can try one (only one) of the following:

Code: Select all

Ctrl:: Send, ^{Ctrl down}
Ctrl:: Send, {Ctrl}{Ctrl down}
Ctrl:: Send, {Ctrl down}{Ctrl up}{Ctrl down}
NorInd
Posts: 43
Joined: 03 May 2020, 04:23

Re: How to disable a hotkey of a background software?

24 Apr 2021, 22:31

I though of a possible solution: use ControlSend to send ctrl to only the current active window. (therefore, the ctrl sent to AA.exe will be blocked.)
However, it can cause potential problems, eg: some of the other background apps that uses global hotkeys will be blocked too.
Haven't test it yet.
NorInd
Posts: 43
Joined: 03 May 2020, 04:23

Re: How to disable a hotkey of a background software?

06 May 2021, 00:46

ControlSend does not allow you to hold down a key. I cannot think of other ways.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, RussF and 303 guests