
نوشته اصلی از سوی
Mehrbod
اینهم یک نمونهیِ پیشرفتهتر از همین داغکلید که بافتار-سُهشمند (context-sensitive) ٸه:
کد:
$!,::
$^t::
Terminate:
{
if (winactive("ahk_class MozillaWindowClass") && winactive("Mozilla-Firefox"))
SendInput, ^t
else IfWinActive, ahk_class MozillaWindowClass
SendInput, !{F4}
else IfWinActive, ahk_class MozillaUIWindowClass
SendInput, ^t
else IfWinActive, ahk_class Chrome_WidgetWin_0
SendInput, ^w
else IfWinActive, Microsoft Outlook
SendInput, !{space}n
else IfWinActive, ahk_class PuTTY
SendInput, ^t
else IfWinActive, ahk_class LaunchUnrealUWindowsClient
SendInput, ^t
else IfWinActive, Command & Conquer Red Alert 3
SendInput, ^t
else IfWinActive, Saints Row
SendInput, ^t
else
SendInput, !{F4}
return
}
با این برخی جاها مانند firefox همان t^ را میفرستیم, دیگرجاها {F4}!