I'm a total AutoHotKey novice but hashed up the following script to close apps with "numpad enter".
There are a couple of exceptions though, the calculator (which I don't want to close with numpadenter, for obvious reasons) and Firefox where I close the active tab, rather than the app itself.
NumpadEnter::
; Firefox gets a close tab command
IfWinActive ,ahk_class MozillaUIWindowClass
{ send ^w
return
}
else
; Calc gets normal behavior for a numpad enter
IfWinActive ,ahk_class CALCVIEWCLASS
{ send {Enter}
return
}
; Send Alt+F4 to everything else
PostMessage, 0x112, 0xF060,,, A
I would additionally like to minimize Firefox if there is only a blank "Untitled" tab open, is there some hack to test for this?