Page 1 of 1

Win active

Posted: 20 Jul 2018, 12:08
by Aoky Carmona
Hi, I program this code:

Code: Select all

If WinActive, ahk_class indesign
	{MButton:: Send, {Space Down}{LButton Down}
	MButton Up:: Send, {Lbutton Up}{Space Up}
	Return
	}
But if I change to any aplication (like chrome or windows explorer) it keeps doing the same function.

Re: Win active  Topic is solved

Posted: 20 Jul 2018, 12:18
by gregster
Please look up context-sensitive hotkeys and the difference between commands and #-directives

Code: Select all

#IfWinActive, ahk_class indesign
	MButton:: Send, {Space Down}{LButton Down}
	MButton Up:: Send, {Lbutton Up}{Space Up}
#If
You could start with the tutorial: https://autohotkey.com/docs/Tutorial.htm#s22 - but don't stop there!
Also compare your other thread: https://autohotkey.com/boards/viewtopic ... 27#p229350