02-20-2013, 07:34 PM
Mehrbod نوشته: همانجا بگذار دوباره script را وا کن درست میشود; map کردن هم ساده است:
کد:^t::SendInput, !{F4}
نمونهوار, اینجا ctrl با t را همزمان بزنی پنجرهیِ کنونی را میبندد: alt + F4 میفرستد.
نمونههایِ بیشتر: AutoHotkey Tutorial: Macro and Hotkey Creation
اینهم یک نمونهیِ پیشرفتهتر از همین داغکلید که بافتار-سُهشمند (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}!
.Unexpected places give you unexpected returns