Macro to make a key do a specific action on 1 window breaks holding that key for others

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Xproplayer
Posts: 24
Joined: 12 Feb 2017, 23:26

Macro to make a key do a specific action on 1 window breaks holding that key for others

24 Sep 2018, 23:07

Code: Select all

$XButton1::
IfWinActive, ahk_exe Discord.exe
{
Send {Click}
Send ^v
}
IfWinNotActive, ahk_exe Discord.exe
{
Send {Xbutton1}
}
return
This code here makes it so xbutton1 has a different action on discord, but it now prevents me from pressing and holding the key in other programs, and instead sends 1 click. How can I fix this?
Spark
Posts: 80
Joined: 04 Jan 2017, 02:22

Re: Macro to make a key do a specific action on 1 window breaks holding that key for others

24 Sep 2018, 23:27

Hello,
try :

Code: Select all

#IfWinActive, ahk_exe Discord.exe
$XButton1::
Send {Click}
Sleep, 75
Send ^v
return
#IfWinActive
HTH
Xproplayer
Posts: 24
Joined: 12 Feb 2017, 23:26

Re: Macro to make a key do a specific action on 1 window breaks holding that key for others

24 Sep 2018, 23:34

Spark wrote:Hello,
try :

Code: Select all

#IfWinActive, ahk_exe Discord.exe
$XButton1::
Send {Click}
Sleep, 75
Send ^v
return
#IfWinActive
HTH
Oh man no way, you can run the if statements before the macro key eh? That changes things.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, Descolada, Oblomov228 and 172 guests