Disable Key in Certain Programs Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JohnMartok
Posts: 8
Joined: 18 Sep 2022, 19:22

Disable Key in Certain Programs

Post by JohnMartok » 26 Sep 2022, 12:19

Hi,

I'm using the F2 key to hold down on the left mouse key. I also have a key to disable the function (Shift F2). Is there way to add to the script that it doesn't work (doesn't hold down on the mouse key - just presses F2) if a certain program is running? For example, in Firefox I'd like to disable it. Thanks!

Code: Select all

enabled := true
F2::
if enabled
{
	if( not GetKeyState("LButton" , "P") )
        	Click down
}
else
	Send, {F2}

return

F2 Up::Send {Lbutton Up} ;

return

+F2::
enabled := !enabled

return


Post Reply

Return to “Ask for Help (v1)”