Skip to content

AHK (AutoHotkey) ​

Wait for a window to appear, then bind hotkey to it (context sensitive) ​

@see https://www.autohotkey.com/docs/v2/lib/_HotIf.htm

if WinWait("ahk_exe DOSBox.exe") {
	#HotIf WinExist("ahk_exe DOSBox.exe")
		Esc:: {
			If (A_PriorHotkey = "Esc" and A_TimeSincePriorHotkey < 500) {
				ProcessClose "dosbox.exe"
				Run "taskkill /im dosbox.exe /F",, "Hide"    
			}
		}
}