I am mapping Alt+F4 to ESC so that I can close windows just by pressing escape. However there are two windows that I need to actually use ESC in. So, when either of these two windows are active I want to be able to press ESC without closing the window. What is the easiest way to accomplish this? I have my script working when I just am excluding one active window but I need to work when either of the two windows are active.
Here is my attempted code:
GroupAdd, ESC, Untitled - Notepad
GroupAdd, ESC,
#IfWinNotActive, ahk_group, ESC
Escape::!F4
Return
This is the code that works properly with just one window:
;#IfWinNotActive, Untitled - Notepad
;Escape::!F4
;Return
UPDATE: Should this work?
SetTitleMatchMode, 2
SetTitleMatchMode, 2
#IfWinNotActive, Untitled - Notepad
#IfWinNotActive, Document 1 - Microsoft Word
Escape::!F4
Return