I am trying to remap two keys with the Hotkey command while Chrome is active, so that one key will trigger the other which will trigger an event.
But I encountered a peculiar problem.
This works:
Code: Select all
Hotkey, F1, test1, on
Hotkey, F3, test2, on
Return
test1:
Send {F3}
Return
test2:
msgbox Hello
Return
Code: Select all
SetTitleMatchMode, 2
#if WinActive("ahk_exe chrome.exe")
Hotkey, F1, test1, on
Hotkey, F3, test2, on
Return
test1:
Send {F3}
Return
test2:
msgbox Hello
Return
I doubled checked and Chrome is active and its wintitle is correct. if I remove the entire #if condition, the remap will work and the msgbox will appear. But with it, it wont.
What exactly causes this and how I can fix it?