¹®¸Æ-°¨Áö ÇÖÅ°¿Í ÇÖ½ºÆ®¸µÀ» ¸¸µì´Ï´Ù. ¹®¸Æ °¨Áö ÇÖÅ°´Â Ç¥Çö½ÄÀÇ °á°ú¿¡ µû¶ó ´Ù¸£°Ô Á¶Ä¡¸¦ ¼öÇàÇÕ´Ï´Ù (¶Ç´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù).
#If [, Expression ]
À¯È¿ÇÑ Ç¥Çö½Ä.
À¯È¿ÇÑ ¿¬»ê½ÄÀ̸é ÇÖÅ°°¡ È°¼ºÈ µÉ ¹®¸ÆÀ» Á¤ÀÇÇÏ´Â µ¥ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î:
#If WinActive("ahk_class Notepad") or WinActive(MyWindowTitle) #Space::MsgBox You pressed Win+Spacebar in Notepad or %MyWindowTitle%.
#IfWin Áö½Ã¾îó·³, #Ifµµ À§Ä¡¿¡ ¹Î°¨ÇÕ´Ï´Ù: ½ºÅ©¸³Æ®¿¡¼ ¹°¸®ÀûÀ¸·Î ¾Æ·¡¿¡ ÀÖ´Â ¸ðµç ÇÖÅ°¿Í ÇÖ½ºÆ®¸µ¿¡ ¿µÇâÀ» ÁÝ´Ï´Ù. #If ±×¸®°í #IfWin´Â ¶Ç »óÈ£ ¹èŸÀûÀÔ´Ï´Ù; Áï, °¡Àå ÃÖ±ÙÀÇ #If ¶Ç´Â #IfWin¸¸ È¿°ú°¡ ÀÖ½À´Ï´Ù.
¹®¸Æ °¨Áö¸¦ ²ô·Á¸é, ¸ðµç ¸Å°³º¯¼ö¸¦ »ý·«ÇÏ°í #If ¶Ç´Â #IfWin Áö½Ã¾î¸¦ ÁöÁ¤ÇÏ¸é µË´Ï´Ù. ¿¹¸¦ µé¾î:
#If
ÇÖÅ°¸¦ ±¸¼ºÇÏ´Â Å° Á¶ÇÕÀÌ ´¸®¸é, #If Ç¥Çö½ÄÀ» Æò°¡ÇÏ¿© ±× ÇÖÅ°¸¦ È°¼ºÈ ÇÒÁö ¸»Áö¸¦ °áÁ¤ÇÕ´Ï´Ù. Ç¥Çö½ÄÀÇ Æò°¡°¡ ¿Ï·áµÉ ¶§±îÁö ¶Ç´Â ½Ã°£Á¦ÇÑÀÌ Ç®¸± ¶§±îÁö ½Ã½ºÅÛÀº Å°º¸µå³ª ¸¶¿ì½º ÀԷ¿¡ ÀÀ´äÇÏÁö ¾ÊÀ» °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù. Ç¥Çö½ÄÀÌ Æò°¡µÇ°í ÀÖ´Â µ¿¾È¿¡ (¿¹¸¦ µé¾î Ç¥Çö½ÄÀÌ È£ÃâÇÑ ÇÔ¼ö·ÎºÎÅÍ) Å°´¸²À̳ª ¸¶¿ì½º Ŭ¸¯À» Àü¼ÛÇÏ¸é º¹ÀâÇÑ ÀÏÀÌ ¾ß±âµÇ¹Ç·Î ÇÇÇÏ´Â ÆíÀÌ ÁÁ½À´Ï´Ù.
Ç¥Çö½ÄÀº ÇÁ·Î±×·¥ÀÌ ÇÖÅ°°¡ È°¼ºÈµÇ¾î ÀÖ´ÂÁö ¾Ë ÇÊ¿ä°¡ ÀÖÀ» ¶§¸¶´Ù Æò°¡µÉ ¼öµµ ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î, a & b::
¿Í °°Àº ¸ÂÃã Á¶ÇÕ¿¡ ´ëÇÏ¿© #If Ç¥Çö½ÄÀº Á¢µÎ Å°°¡ (ÀÌ ¿¹Á¦¿¡¼´Â a
) ´¸± ¶§ Æò°¡µÇ¾î, ¸ÂÃã ¼ö½Ä Å°·Î ÇàÀ§ÇØ¾ß ÇÒÁö ¸»Áö °áÁ¤ÇÕ´Ï´Ù.
À§¿¡ ±â¼úÇÑ ÀÌÀ¯ ¶§¹®¿¡, Ç¥Çö½ÄÀº ¹Ýµå½Ã »¡¸® ¿Ï·áµÇµµ·Ï ±×¸®°í ºÎÀÛ¿ëÀÌ ¾øµµ·Ï ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù.
[AHK_L 53+]: A_ThisHotkey¿Í A_TimeSinceThisHotkey´Â ÇöÀç #If Ç¥Çö½ÄÀÌ Æò°¡µÇ°í ÀÖ´Â ÇÖÅ°¿¡ ±â¹ÝÇϵµ·Ï ¼³Á¤µË´Ï´Ù.
[v1.0.95.00+]: A_PriorHotkey¿Í A_TimeSincePriorHotkey´Â Àӽ÷Π"This" º¯¼ö¿¡ »óÀÀÇÏ´Â ÀÌÀüÀÇ °ªÀ» ´ã°í ÀÖ½À´Ï´Ù.
#IfWin Áö½Ã¾îÀÇ ÇàÀ§ Ư¼ºÀº ´ëºÎºÐ #If¿¡µµ Àû¿ëµË´Ï´Ù.
#IfTimeoutÀ» »ç¿ëÇÏ¸é ±âº» ½Ã°£Á¦ÇÑ °ªÀ» ¹Ù²Ü ¼ö ÀÖ½À´Ï´Ù.
; ¿¹Á¦ 1: ŽºÅ© ¹Ù À§¿¡¼ ¸¶¿ì½º ÈÙÀ» ½ºÅ©·ÑÇؼ º¼·ýÀ» Á¶ÀýÇÕ´Ï´Ù. #If MouseIsOver("ahk_class Shell_TrayWnd") WheelUp::Send {Volume_Up} WheelDown::Send {Volume_Down} MouseIsOver(WinTitle) { MouseGetPos,,, Win return WinExist(WinTitle . " ahk_id " . Win) } ; ¿¹Á¦ 2: ¸ðµç ÆíÁý ÄÜÆ®·ÑÀ» À§ÇÑ °£´ÜÇÑ ´Ü¾î-»èÁ¦ ´ÜÃàÅ°. #If ActiveControlIsOfClass("Edit") ^BS::Send ^+{Left}{Del} ^Del::Send ^+{Right}{Del} ActiveControlIsOfClass(Class) { ControlGetFocus, FocusedControl, A ControlGet, FocusedControlHwnd, Hwnd,, %FocusedControl%, A WinGetClass, FocusedControlClass, ahk_id %FocusedControlHwnd% return (FocusedControlClass=Class) } ; ¿¹Á¦ 3: ¹®¸Æ-°¨Áö ÇÖÅ°. #If Esc::ExitApp ; ¿¹Á¦ 4: µ¿ÀûÀÎ ÇÖÅ°. ¿¹Á¦ 1À» ÇÊ¿ä·Î ÇÔ. NumpadAdd:: Hotkey, If, MouseIsOver("ahk_class Shell_TrayWnd") if (doubleup := !doubleup) Hotkey, WheelUp, DoubleUp else Hotkey, WheelUp, WheelUp return DoubleUp: Send {Volume_Up 2} return