Á¶À̽ºÆ½À» Å°º¸µå³ª ¸¶¿ì½º¿¡ ¸®¸ÊÇϱâ

¸ñÂ÷

Áß¿äÇÑ °íÁö »çÇ×

Á¶À̽ºÆ½ ¹öÆ°ÀÌ Å°´­¸²À̳ª ¸¶¿ì½º Ŭ¸¯À» º¸³»µµ·Ï ¸¸µé±â

¾Æ·¡¿¡ ¼¼ °¡Áö Á¢±Ù¹ýÀÌ ÀÖ½À´Ï´Ù. °¡Àå ½¬¿î ¹æ¹ý¿¡¼­ ½ÃÀÛÇÏ¿© °¡Àå º¹ÀâÇÑ ¹æ¹ýÀ¸·Î ³¡³³´Ï´Ù. º¹ÀâÇÑ ¹æ¹ýÀº ±¤¹üÀ§ÇÑ »óȲ¿¡ ÀÛµ¿ÇÕ´Ï´Ù (¿¹¸¦ µé¾î Å°³ª ¸¶¿ì½º ¹öÆ°À» ´©¸¥ ä·Î Àֱ⸦ ¿ä±¸ÇÏ´Â °ÔÀÓ).

¹æ¹ý #1: ÀÌ ¹æ¹ýÀº °£´ÜÇÑ Å°´­¸²°ú ¸¶¿ì½º Ŭ¸¯À» Àü¼ÛÇÕ´Ï´Ù. ¿¹¸¦ µé¾î:

Joy1::Send {Left}  ; ¹öÆ° #1ÀÌ ¿ÞÂÊ È­»ìÇ¥ Å° ´­¸²À» Àü¼ÛÇϵµ·Ï ¸¸µì´Ï´Ù.
Joy2::Click  ; ¹öÆ° #2°¡ ¿ÞÂÊ ¸¶¿ì½º ¹öÆ° Ŭ¸¯À» Àü¼ÛÇϵµ·Ï ¸¸µì´Ï´Ù.
Joy3::Send a{Esc}{Space}{Enter}  ; ¹öÆ° #3ÀÌ ±âÈ£ "a" ¿Í ´ÙÀ½¿¡ ÇǽŠ¹®ÀÚ, ½ºÆäÀ̽º, ±×¸®°í ¿£Å͸¦ Àü¼ÛÇϵµ·Ï ¸¸µì´Ï´Ù.
Joy4::Send Sincerely,{Enter}John Smith  ; ¹öÆ° #4°¡ µÎ ÁÙÀÇ ¼­¸íÀ» º¸³»µµ·Ï ¸¸µì´Ï´Ù.

¹öÆ°¿¡°Ô Çϳª ÀÌ»óÀÇ ¸í·É¾î¸¦ ¼öÇàÇϵµ·Ï ¸¸µé·Á¸é, ù ¸í·É¾î¸¦ ¹öÆ° À̸§ ¾Æ·¡¿¡ µÎ°í ¸¶Áö¸· ¸í·É¾î¸¦ returnÀ¸·Î ¸¸µé¸é µË´Ï´Ù. ¿¹¸¦ µé¾î:

Joy5::
Run Notepad
WinWait Untitled - Notepad
WinActivate
Send ÀÌ ÅؽºÆ®´Â ³ëÆ®Æе忡 ³ªÅ¸³³´Ï´Ù.{Enter}
return

¿ÏÀüÇÑ Å°¿Í ¸¶¿ì½º/Á¶À̽ºÆ½ ¹öÆ°¿¡ ´ëÇÑ Å° ¸ñ·ÏÀ» ÂüÁ¶ÇϽʽÿÀ.


¹æ¹ý #2: ÀÌ ¹æ¹ýÀº Á¶À̽ºÆ½ ¹öÆ°À» ´©¸£°í ÀÖ´Â µ¿¾È Å°³ª ¸¶¿ì½º ¹öÆ°ÀÌ ¹Ýµå½Ã ´­·Á ÀÖ¾î¾ß ÇÏ´Â °æ¿ì¿¡ ÇʼöÀÔ´Ï´Ù. ´ÙÀ½ ¿¹Á¦´Â Á¶À̽ºÆ½ÀÇ µÎ ¹ø° ¹öÆ°ÀÌ ¿ÞÂÊ È­»ìÇ¥ Å°°¡ µÇµµ·Ï ¸¸µì´Ï´Ù:

Joy2::
Send {Left down}  ; ¿ÞÂÊ È­»ìÇ¥ Å°¸¦ ´©¸¨´Ï´Ù.
KeyWait Joy2  ; »ç¿ëÀÚ°¡ Á¶À̽ºÆ½ ¹öÆ°À» ¶¿ ¶§±îÁö ±â´Ù¸³´Ï´Ù.
Send {Left up}  ; ¿ÞÂÊ È­»ìÇ¥ Å°¸¦ ¶Á´Ï´Ù.
return

¹æ¹ý #3: ÀÌ ¹æ¹ýÀº ¹æ¹ý #2¿¡ ±â¼úµÈ À¯ÇüÀÇ Á¶À̽ºÆ½ ÇÖÅ°°¡ Çϳª ÀÌ»ó ÀÖ°í, Á¾Á¾ ±×·± ÇÖÅ°¸¦ µ¿½Ã¿¡ ´©¸£°í ¶¼¾î¾ß ÇÒ °æ¿ì¿¡ ÇʼöÀÔ´Ï´Ù. ´ÙÀ½ ¿¹Á¦´Â Á¶À̽ºÆ½ÀÇ ¼¼¹ø° ¹öÆ°ÀÌ ¿ÞÂÊ ¸¶¿ì½º ¹öÆ°ÀÌ µÇµµ·Ï ¸¸µì´Ï´Ù:

Joy3::
Send {LButton down}   ; ¿ÞÂÊ ¸¶¿ì½º ¹öÆ°À» ´©¸¨´Ï´Ù.
SetTimer, WaitForButtonUp3, 10
return

WaitForButtonUp3:
if GetKeyState("Joy3")  ; ¹öÆ°ÀÌ ¿©ÀüÈ÷ ´­·Á ÀÖ½À´Ï´Ù. ±×·¡¼­ °è¼Ó ±â´Ù¸³´Ï´Ù.
    return
; ±×·¸Áö ¾ÊÀ¸¸é, ¹öÆ°À» ¶Ã½À´Ï´Ù.
Send {LButton up}  ; ¿ÞÂÊ ¸¶¿ì½º ¹öÆ°À» ¶Á´Ï´Ù.
SetTimer, WaitForButtonUp3, off
return

ÀÚµ¿-¹Ýº¹ Å°´­¸²: ¾î¶² ÇÁ·Î±×·¥À̳ª °ÔÀÓÀº (¸¶Ä¡ Å°º¸µå¸¦ °è¼Ó ´©¸¥ ä·Î ÀÖ´Â °Íó·³) Å°°¡ ¹Ýº¹ÀûÀ¸·Î Àü¼ÛµÇ±â¸¦ ¿ä±¸ÇÕ´Ï´Ù. ´ÙÀ½ ¿¹Á¦´Â Á¶À̽ºÆ½ÀÇ µÎ ¹ø° ¹öÆ°À» ´©¸£°í ÀÖ´Â µ¿¾È ½ºÆäÀ̽º¹Ù Å°´­¸²À» ¹Ýº¹ÀûÀ¸·Î Àü¼ÛÇÕ´Ï´Ù:

Joy2::
Send {Space down}   ; ½ºÆäÀ̹ٸ¦ ´©¸¨´Ï´Ù.
SetTimer, WaitForJoy2, 30  ; ¹øÈ£¸¦ 30¿¡¼­ 20À̳ª 10À¸·Î ÁÙ¿© ´õ ºü¸£°Ô Å°¸¦ Àü¼ÛÇÕ´Ï´Ù. ´õ Áõ°¡½ÃÅ°¸é ´õ ´À¸®°Ô Àü¼ÛµË´Ï´Ù.
return

WaitForJoy2:
if not GetKeyState("Joy2")  ; ¹öÆ°À» ¶Ã½À´Ï´Ù.
{
    Send {Space up}  ; ½ºÆäÀ̽º¹Ù¸¦ ¶Á´Ï´Ù.
    SetTimer, WaitForJoy2, off  ; ¹öÆ° °üÁ¦¸¦ ¸ØÃä´Ï´Ù.
    return
}
; À§´Â "¹ÝȯµÇÁö ¾Ê¾Ò±â ¶§¹®¿¡", ¹öÆ°Àº ¿©ÀüÈ÷ ´­¸° ä·Î ÀÖ½À´Ï´Ù.
Send {Space down}  ; ¶Ç´Ù¸¥ ½ºÆäÀ̽º¹Ù Å°´­¸²À» Àü¼ÛÇÕ´Ï´Ù.
return

¹®¸Æ-°¨Áö Á¶À̽ºÆ½ ¹öÆ°: Áö½Ã¾î #IfWinActive/Exist¸¦ »ç¿ëÇÏ¸é ¼±ÅÃµÈ Á¶À̽ºÆ½ ¹öÆ°ÀÌ È°¼ºÈ­ »óÅ ¶Ç´Â Á¸ÀçÇϴ âÀÇ Á¾·ù¿¡ µû¶ó ´Ù¸¥ ÇàÀ§¸¦ ¼öÇàÇϵµ·Ï (¶Ç´Â ÀüÇô ¸øÇϵµ·Ï) ¸¸µé ¼ö ÀÖ½À´Ï´Ù.

Á¶À̽ºÆ½À» ¸¶¿ì½ºÃ³·³ »ç¿ëÇϱâ: Joystick-To-Mouse ½ºÅ©¸³Æ®´Â Á¶À̽ºÆ½À» ±×ÀÇ ¹öÆ°°ú Ãà ÄÜÆ®·ÑÀ» ¸®¸ÊÇÎÇÏ¿© ¸¶¿ì½º·Î Å»¹Ù²Þ½Ãŵ´Ï´Ù.

Á¶À̽ºÆ½ Ãà ¶Ç´Â POV HatÀÌ Å°´­¸²À̳ª ¸¶¿ì½º Ŭ¸¯À» Àü¼ÛÇϵµ·Ï ¸¸µé±â

½ºÅ©¸³Æ®°¡ Á¶À̽ºÆ½ ÃàÀ̳ª POV hatÀÇ ¿òÁ÷ÀÓ¿¡ ¹ÝÀÀÇϵµ·Ï ¸¸µé·Á¸é, SetTimer°ú GetKeyState¸¦ »ç¿ëÇϽʽÿÀ. ´ÙÀ½ ¿¹Á¦´Â Á¶À̽ºÆ½ÀÇ X¿Í Y ÃàÀ» ¸¶Ä¡ Å°º¸µå À§ÀÇ È­»ìÇ¥ Å° ±ºÃ³·³ ÇàÀ§ÇÏ°Ô ¸¸µì´Ï´Ù (»óÇÏÁ¿ì):

#Persistent  ; ½ºÅ©¸³Æ®¸¦ »ç¿ëÀÚ°¡ ¸í½ÃÀûÀ¸·Î Á¾·áÇÒ ¶§±îÁö ½ÇÇàÇÕ´Ï´Ù.
SetTimer, WatchAxis, 5
return

WatchAxis:
GetKeyState, JoyX, JoyX  ; X ÃàÀÇ À§Ä¡¸¦ ¾ò½À´Ï´Ù.
GetKeyState, JoyY, JoyY  ; Y ÃàÀÇ À§Ä¡¸¦ ¾ò½À´Ï´Ù.
KeyToHoldDownPrev = %KeyToHoldDown%  ; Prev´Â ÀÌÁ¦ ÀÌÀü¿¡ ³î¸° Å°¸¦ (ÀÖ´Ù¸é) º¸À¯ÇÕ´Ï´Ù.

if JoyX > 70
    KeyToHoldDown = Right
else if JoyX < 30
    KeyToHoldDown = Left
else if JoyY > 70
    KeyToHoldDown = Down
else if JoyY < 30
    KeyToHoldDown = Up
else
    KeyToHoldDown =

if KeyToHoldDown = %KeyToHoldDownPrev%  ; ¿Ã¹Ù¸¥ Å°°¡ ÀÌ¹Ì ´­·Á ÀÖ½À´Ï´Ù (¶Ç´Â ¾Æ¹« Å°µµ ÇÊ¿äÇÏÁö ¾Ê½À´Ï´Ù).
    return  ; ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.

; ±×·¸Áö ¾ÊÀ¸¸é, ÀÌÀüÀÇ Å°¸¦ ¶¼°í »õ·Î¿î Å°¸¦ ´©¸¨´Ï´Ù:
SetKeyDelay -1  ; Å°´­¸² »çÀÌ¿¡ Áö¿¬À» ÇÇÇÕ´Ï´Ù.
if KeyToHoldDownPrev   ; ¶¼¾ß ÇÒ ÀÌÀüÀÇ Å°°¡ ÀÖ½À´Ï´Ù.
    Send, {%KeyToHoldDownPrev% up}  ; ±× Å°¸¦ ¶Á´Ï´Ù.
if KeyToHoldDown   ; ´©¸¦ Å°°¡ ÀÖ½À´Ï´Ù.
    Send, {%KeyToHoldDown% down}  ; ±× Å°¸¦ ´©¸¨´Ï´Ù.
return

 

´ÙÀ½ ¿¹Á¦´Â Á¶À̽ºÆ½ÀÇ POV hatÀÌ ¸¶Ä¡ Å°º¸µåÀÇ È­»ìÇ¥ ±ºÃ³·³ ÇàÀ§ÇÏ°Ô ¸¸µì´Ï´Ù; Áï, POV hatÀº È­»ìÇ¥ Å°´­¸²À» Àü¼ÛÇÕ´Ï´Ù (»óÇÏÁ¿ì):

#Persistent  ; »ç¿ëÀÚ°¡ ¸í½ÃÀûÀ¸·Î Á¾·áÇÒ ¶§±îÁö ½ºÅ©¸³Æ®¸¦ °è¼Ó ½ÇÇàÇÕ´Ï´Ù.
SetTimer, WatchPOV, 5
return

WatchPOV:
GetKeyState, POV, JoyPOV  ; POV ÄÜÆ®·ÑÀÇ À§Ä¡¸¦ ¾ò½À´Ï´Ù.
KeyToHoldDownPrev = %KeyToHoldDown%  ; Prev´Â ÀÌÁ¦ ÀÌÀü¿¡ ´­¸° Å°¸¦ (ÀÖ´Ù¸é) º¸À¯ÇÕ´Ï´Ù.

; ¾î¶² Á¶À̽ºÆ½Àº °íÁ¤ Áõ°¡µÇÁö ¾Ê°í ºÎµå·¯¿î/¿¬¼ÓÀûÀÎ POV¸¦ °¡Áý´Ï´Ù.
; ±×µé ¸ðµÎ¸¦ Áö¿øÇÏ·Á¸é, ¹üÀ§¸¦ »ç¿ëÇϽʽÿÀ:
if POV < 0   ; º¸°íÇÒ °¢µµ°¡ ¾ø½À´Ï´Ù
    KeyToHoldDown =
else if POV > 31500                 ; 315 µµºÎÅÍ 360 µµ±îÁö: ¾ÕÀ¸·Î
    KeyToHoldDown = Up
else if POV between 0 and 4500      ; 0 µµºÎÅÍ 45 µµ±îÁö: ¾ÕÀ¸·Î
    KeyToHoldDown = Up
else if POV between 4501 and 13500  ; 45 µµºÎÅÍ 135 µµ±îÁö: ¿À¸¥ÂÊÀ¸·Î
    KeyToHoldDown = Right
else if POV between 13501 and 22500 ; 135 µµºÎÅÍ 225 µµ±îÁö: ¾Æ·§ÂÊÀ¸·Î
    KeyToHoldDown = Down
else                                ; 225 µµºÎÅÍ 315 µµ±îÁö: ¿ÞÂÊÀ¸·Î
    KeyToHoldDown = Left

if KeyToHoldDown = %KeyToHoldDownPrev%  ; ¿Ã¹Ù¸¥ Å°°¡ ÀÌ¹Ì ´­·Á ÀÖ½À´Ï´Ù (¶Ç´Â ¾Æ¹« Å°µµ ÇÊ¿äÇÏÁö ¾Ê½À´Ï´Ù).
    return  ; ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.

; ±×·¸Áö ¾ÊÀ¸¸é, ÀÌÀüÀÇ Å°¸¦ ¶¼°í »õ Å°¸¦ ´©¸¨´Ï´Ù:
SetKeyDelay -1  ; Å°´­¸² »çÀÌ¿¡ Áö¿¬À» ÇÇÇÕ´Ï´Ù.
if KeyToHoldDownPrev   ; ¶¼¾ß ÇÒ ÀÌÀüÀÇ Å°°¡ ÀÖ½À´Ï´Ù.
    Send, {%KeyToHoldDownPrev% up}  ; ±× Å°¸¦ ¶Á´Ï´Ù.
if KeyToHoldDown   ; ´©¸¦ Å°°¡ ÀÖ½À´Ï´Ù.
    Send, {%KeyToHoldDown% down}  ; ±× Å°¸¦ ´©¸¨´Ï´Ù.
return

 

Å°´­¸² ÀÚµ¿-¹Ýº¹Çϱâ: µÎ ¿¹Á¦ ¸ðµÎ ´Ü¼øÈ÷ Å°¸¦ ´©¸£°í ÀÖ´Â°Ô ¾Æ´Ï¶ó Å°¸¦ ¹Ýº¹ÀûÀ¸·Î Àü¼ÛÇϵµ·Ï º¯°æÇÒ ¼ö ÀÖ½À´Ï´Ù (Áï, Å°º¸µå¿¡¼­ ¹°¸®ÀûÀ¸·Î Å°¸¦ ´©¸£°í ÀÖ´Â °Íó·³ Èä³»³¾ ¼ö ÀÖ½À´Ï´Ù). ÀÌ·¸°Ô ÇÏ·Á¸é, ´ÙÀ½ ÁÙÀ»:

return  ; ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.

´ÙÀ½°ú °°ÀÌ ±³Ã¼ÇϽʽÿÀ:

{
    if KeyToHoldDown
        Send, {%KeyToHoldDown% down}  ; Å°´­¸²À» ÀÚµ¿À¸·Î ¹Ýº¹ÇÕ´Ï´Ù.
    return
}

³íÆò

ù ¹ø° ¸»°í ´Ù¸¥ Á¶À̽ºÆ½À» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¹öÆ° À̸§À̳ª Ãà À̸§ ¾Õ¿¡ Á¶À̽ºÆ½ ¹öÆ° ¹øÈ£¸¦ ÁÖ¸é µË´Ï´Ù. ¿¹¸¦ µé¾î, 2Joy1Àº µÎ ¹ø° Á¶À̽ºÆ½ÀÇ Ã¹ ¹ø° ¹öÆ°ÀÔ´Ï´Ù.

´Ù¸¥ À¯¿ëÇÑ Á¶À̽ºÆ½ ½ºÅ©¸³Æ®¸¦ ¹ß±¼ÇÏ·Á¸é AutoHotkey Æ÷·³À» ¹æ¹®ÇϽʽÿÀ. Joystick and GetKeyState and Send¿Í °°Àº Å°¿öµå °Ë»öÀ̸é Èï¹Ì·Î¿î ÁÖÁ¦µéÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.

°ü·Ã ÁÖÁ¦

Joystick-To-Mouse ½ºÅ©¸³Æ® (Á¶À̽ºÆ½À» ¸¶¿ì½º·Î »ç¿ëÇϱâ)
Á¶À̽ºÆ½ ¹öÆ°, Ãà, ±×¸®°í ÄÜÆ®·Ñ ¸®½ºÆ®
GetKeyState
Å°º¸µå¿Í ¸¶¿ì½º ¸®¸ÊÇÎÇϱâ