Å°º¸µåÀÇ ³ÑÆе带 ¸¶¿ì½ºÃ³·³ »ç¿ëÇÏ´Â ¹ý -- by deguix

ÀÌ ½ºÅ©¸³Æ®´Â Å°º¸µå¸¦ ¸¶¿ì½ºÃ³·³ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁÝ´Ï´Ù. °ÅÀÇ ½ÇÁ¦ ¸¶¿ì½º¸¦ »ç¿ëÇÏ´Â °Í°ú ºñ½ÁÇÏ°Ô ½±½À´Ï´Ù (¾î¶² ÀÛ¾÷¿¡´Â ÈξÀ ´õ ½¬¿ï ¼ö ÀÖ½À´Ï´Ù). ÃÖ´ë ´Ù¼¸ °³ÀÇ ¸¶¿ì½º ¹öÆ°À» Áö¿øÇÏ¸ç ¸¶¿ì½º ÈÙÀ» ȸÀüÇÒ ¼ö ÀÖ½À´Ï´Ù. ¶ÇÇÑ À̵¿ ¼Óµµ, °¡¼Ó ±â´É, ±×¸®°í "Ãà µÚÁý±â"¸¦ Àç´ÜÇÒ ¼ö ÀÖ½À´Ï´Ù.

ÀÌ ½ºÅ©¸³Æ² ³»·Á ¹Þ±â  |  ´Ù¸¥ »ùÇà ½ºÅ©¸³Æ®  |  È¨À¸·Î

/*
o------------------------------------------------------------o
|Å°º¸µåÀÇ ³ÑÆе带 ¸¶¿ì½º·Î »ç¿ëÇ챉                         |
(------------------------------------------------------------)
| By deguix           / ¿ÀÅäÇÖÅ° 1.0.22+ ¿ë ½ºÅ©¸³Æ® ÆÄÀÏ    |
|                    ----------------------------------------|
|                                                            |
|    ÀÌ ½ºÅ©¸³Æ®´Â ¿ÀÅäÇÖÅ°ÀÇ »ç¿ë¹ýÀ» º¸¿©ÁÖ´Â ¿¹Á¦ÀÔ´Ï´Ù.  |
| Å°º¸µåÀÇ ³ÑÆеå Å°¸¦ ¸®¸ÊÇؼ­ ¸¶¿ì½º·Î¼­ º¯½Å½Ãŵ´Ï´Ù.     |
| °¡¼Ó ±â´ÉÀÌ µé¾î À־ Å°¸¦ ¿À·§ ´©¸£°í ÀÖÀ¸¸é ¸¶¿ì½º     |
| À̵¿À» °¡¼ÓÇÒ ¼ö ÀÖ½À´Ï´Ù´Ù. ȸÀü ±â´Éµµ °®Ãß°í À־     |
| ³ÑÆÐµå ¸¶¿ì½º¸¦ "µ¹¸± ¼ö ÀÖ½À´Ï´Ù"                         |
| Áï, NumPadDown¿Í NumPadUp¸¦ ´©¸£¸é ÈÙó·³ µ¹¸± ¼ö ÀÖ½À´Ï´Ù.|
| ¾Æ·¡¿¡ »ç¿ëµÈ Å° ¸®½ºÆ®¸¦ ÂüÁ¶ÇϽʽÿÀ:                    |
|                                                            |
|------------------------------------------------------------|
| Å°                    | ¼³¸í                               |
|------------------------------------------------------------|
| ScrollLock (toggle on)| ³ÑÆÐµå ¸¶¿ì½º ¸ðµå¸¦ È°¼ºÈ­        |
|-----------------------|------------------------------------|
| NumPad0               | ¿Þ¹öÆ° Ŭ¸¯.                       |
| NumPad5               | °¡¿îµ¥ ¹öÆ° Ŭ¸¯.                  |
| NumPadDot             | ¿ì¹öÆ° Ŭ¸¯.                       |
| NumPadDiv/NumPadMult  | X1/X2 ¸¶¿ì½º ¹öÆ° Ŭ¸¯. (Win 2k+)  |
| NumPadSub/NumPadAdd   | ¸¶¿ì½º ÈÙÀ» À§ ¾Æ·¡·Î À̵¿.        |
|                       |                                    |
|-----------------------|------------------------------------|
| NumLock (toggled off) | ¸¶¿ì½º À̵¿ ¸ðµå¸¦ È°¼ºÈ­.         |
|-----------------------|------------------------------------|
| NumPadEnd/Down/PgDn/  | ¸¶¿ì½º À̵¿.                       |
| /Left/Right/Home/Up/  |                                    |
| /PgUp                 |                                    |
|                       |                                    |
|-----------------------|------------------------------------|
| NumLock (toggled on)  | ¸¶¿ì½º ¼Óµµ Á¶Àý ¸ðµå È°¼ºÈ­.      |
|-----------------------|------------------------------------|
| NumPad7/NumPad1       | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù                 |
|                       | °¡¼ÓÀÌ Áõ°¡/°¨¼Ò.                  |
| NumPad8/NumPad2       | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù                 |
|                       | ÃÖÃÊ ¼Óµµ°¡ Áõ°¡/°¨¼Ò.             |
| NumPad9/NumPad3       | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù                 |
|                       | ÃÖ´ë ¼Óµµ°¡ Áõ°¡/°¨¼Ò.             |
| ^NumPad7/^NumPad1     | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù *               |
|                       | ÈÙ °¡¼ÓÀÌ Áõ°¡/°¨¼Ò.               |
| ^NumPad8/^NumPad2     | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù *               |
|                       | ÈÙ Ãʱ⠼ӵµ Áõ°¡/°¨¼Ò.            |
| ^NumPad9/^NumPad3     | ¹öÆ°À» ´©¸¦ ¶§¸¶´Ù *               |
|                       | ÈÙ ÃÖ´ë ¼Óµµ Áõ°¡/°¨¼Ò.            |
| NumPad4/NumPad6       | ¿À¸¥ÂÊÀ¸·Î ȸÀü °¢µµ¸¦ Áõ°¡/°¨¼Ò   |
|                       | Áï, 180° = ¹Ý´ë·Î µÚÁý¾îÁü        |
|------------------------------------------------------------|
| * = ÀÌ ¿É¼ÇÀº Á¦¾îÆÇ¿¡¼­ Á¶ÀýÇÑ ¸¶¿ì½º ÈÙÀÇ ¼ÓµµÀÇ         |
| ¿µÇâÀ» ¹Þ½À´Ï´Ù. ¸¶¿ì½º¿¡ ÈÙÀÌ ¾ø´Ù¸é                      |
| ±âº»°ªÀº ¹öÆ° ´­¸²´ç 3 +/- ÁÙÀÔ´Ï´Ù.                       |
o------------------------------------------------------------o
*/

;ȯ°æ ±¸¼º ½ÃÀÛ

#SingleInstance force
#MaxHotkeysPerInterval 500

; Å°º¸µå °¥°í¸®¸¦ »ç¿ëÇÏ¿© ³ÑÆеå ÇÖÅ°¸¦ ±¸ÇöÇϸé
; à¿Í °°Àº ANSI ¹®ÀÚÀÇ »ý¼ºÀ» °£¼·ÇÏÁö ¾Ê½À´Ï´Ù. 
; ÀÌ ¶§¹®¿¡ ¿ÀÅä ÇÖÅ°´Â ALT¸¦ ´©¸£°í ÀÏ·ÃÀÇ  
; ³ÑÆеå Å°´­¸²À» Àü¼ÛÇÔÀ¸·Î½á ±×·± ¹®ÀÚµéÀ» »ý¼ºÇÕ´Ï´Ù.
; °¥°í¸® ÇÖÅ°´Â ¶È¶ÈÇؼ­ ±×·± Å°´­¸²Àº ¹«½ÃÇÕ´Ï´Ù.
#UseHook

MouseSpeed = 1
MouseAccelerationSpeed = 1
MouseMaxSpeed = 5

; ¸¶¿ì½º ÈÙÀÇ ¼Óµµ´Â Á¦¾îÆÇ¿¡¼­ ¼³Á¤ÇÕ´Ï´Ù.
; º¸ÅëÀÇ ¸¶¿ì½º ÇàÀ§¿¡ ¿µÇâÀ» ¹ÌÄ¡±â ¶§¹®¿¡, ¾Æ·¡ÀÇ ¼¼ °¡Áö ¼³Á¤ÀÇ
; ½ÇÁ¦ ¼Óµµ´Â Á¤»ó ¸¶¿ì½º ÈÙ ¼ÓµµÀÇ µÎ ¹è°¡ µË´Ï´Ù.
MouseWheelSpeed = 1
MouseWheelAccelerationSpeed = 1
MouseWheelMaxSpeed = 5

MouseRotationAngle = 0

;ȯ°æ ±¸¼º ³¡

; ´ÙÀ½Àº ²À ÇÊ¿äÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀ¸¸é Å°´­¸²Àº
; Á¤»óÀûÀÎ Á¶Ä¡¸¦ Àü¼ÛÇÏÁö ¸øÇϱ⠶§¹®ÀÔ´Ï´Ù.
; NumPadDiv¿Í °°Àº °æ¿ì °¡²û "/"À» È­¸é¿¡ Àü¼ÛÇÕ´Ï´Ù
#InstallKeybdHook

Temp = 0
Temp2 = 0

MouseRotationAnglePart = %MouseRotationAngle%
; 45º·Î ³ª´¯´Ï´Ù; ¿Ö³ÄÇϸé MouseMove´Â Á¤¼ö¸¸ Áö¿øÇϱ⠶§¹®ÀÔ´Ï´Ù,
; ±×¸®°í ¸¶¿ì½º ȸÀüÀ» 45ºº¸´Ù ÀÛÀº ¼ýÀÚ·Î º¯°æÇϸé;
; ÀÌ»óÇÑ ÇàÀ§¸¦ ¾ß±âÇÒ ¼ö ÀÖ½À´Ï´Ù.
;
; ¿¹¸¦ µé¾î: 22.5º·Î ÁöÁ¤Çϸé NumPadUp¸¦ ´©¸¦¶§:
;  ¸ÕÀú º¯À» ÇâÇÏ¿© ¼Óµµ°¡ 1¿¡ µµ´ÞÇÒ ¶§±îÁö
;  À§·Î À̵¿ÇÕ´Ï´Ù.
MouseRotationAnglePart /= 45

MouseCurrentAccelerationSpeed = 0
MouseCurrentSpeed = %MouseSpeed%

MouseWheelCurrentAccelerationSpeed = 0
MouseWheelCurrentSpeed = %MouseSpeed%

SetKeyDelay, -1
SetMouseDelay, -1

Hotkey, *NumPad0, ButtonLeftClick
Hotkey, *NumpadIns, ButtonLeftClickIns
Hotkey, *NumPad5, ButtonMiddleClick
Hotkey, *NumpadClear, ButtonMiddleClickClear
Hotkey, *NumPadDot, ButtonRightClick
Hotkey, *NumPadDel, ButtonRightClickDel
Hotkey, *NumPadDiv, ButtonX1Click
Hotkey, *NumPadMult, ButtonX2Click

Hotkey, *NumpadSub, ButtonWheelUp
Hotkey, *NumpadAdd, ButtonWheelDown

Hotkey, *NumPadUp, ButtonUp
Hotkey, *NumPadDown, ButtonDown
Hotkey, *NumPadLeft, ButtonLeft
Hotkey, *NumPadRight, ButtonRight
Hotkey, *NumPadHome, ButtonUpLeft
Hotkey, *NumPadEnd, ButtonUpRight
Hotkey, *NumPadPgUp, ButtonDownLeft
Hotkey, *NumPadPgDn, ButtonDownRight

Hotkey, Numpad8, ButtonSpeedUp
Hotkey, Numpad2, ButtonSpeedDown
Hotkey, Numpad7, ButtonAccelerationSpeedUp
Hotkey, Numpad1, ButtonAccelerationSpeedDown
Hotkey, Numpad9, ButtonMaxSpeedUp
Hotkey, Numpad3, ButtonMaxSpeedDown

Hotkey, Numpad6, ButtonRotationAngleUp
Hotkey, Numpad4, ButtonRotationAngleDown

Hotkey, !Numpad8, ButtonWheelSpeedUp
Hotkey, !Numpad2, ButtonWheelSpeedDown
Hotkey, !Numpad7, ButtonWheelAccelerationSpeedUp
Hotkey, !Numpad1, ButtonWheelAccelerationSpeedDown
Hotkey, !Numpad9, ButtonWheelMaxSpeedUp
Hotkey, !Numpad3, ButtonWheelMaxSpeedDown

Gosub, ~ScrollLock  ; ÇöÀç ½ºÅ©·Ñ¶ôÀÇ »óÅ¿¡ ±â¹ÝÇÏ¿© ÃʱâÈ­ÇÕ´Ï´Ù.
return

; Å° È°¼ºÈ­ Áö¿ø

~ScrollLock::
; Å°¸¦ ¶¼±â¸¦ ±â´Ù¸³´Ï´Ù. ±×·¸Áö ¾ÊÀ¸¸é °¥°í¸® »óÅ°¡
; Å°¸¦ ´©¸£°í ÀÖ´Â µ¿¾È ¸®¼ÂµÇ¾î ¹ö·Á¼­, ¾÷-À̺¥Æ®°¡ ¾ï´­·¯Áý´Ï´Ù,
; À̾ ½ºÅ©·Ñ¶ô »óÅÂ/ºÒºûÀÇ ÅäŬÀ» ¸·¾Æ ¹ö¸³´Ï´Ù:
KeyWait, ScrollLock
GetKeyState, ScrollLockState, ScrollLock, T
If ScrollLockState = D
{
    Hotkey, *NumPad0, on
    Hotkey, *NumpadIns, on
    Hotkey, *NumPad5, on
    Hotkey, *NumPadDot, on
    Hotkey, *NumPadDel, on
    Hotkey, *NumPadDiv, on
    Hotkey, *NumPadMult, on

    Hotkey, *NumpadSub, on
    Hotkey, *NumpadAdd, on

    Hotkey, *NumPadUp, on
    Hotkey, *NumPadDown, on
    Hotkey, *NumPadLeft, on
    Hotkey, *NumPadRight, on
    Hotkey, *NumPadHome, on
    Hotkey, *NumPadEnd, on
    Hotkey, *NumPadPgUp, on
    Hotkey, *NumPadPgDn, on

    Hotkey, Numpad8, on
    Hotkey, Numpad2, on
    Hotkey, Numpad7, on
    Hotkey, Numpad1, on
    Hotkey, Numpad9, on
    Hotkey, Numpad3, on

    Hotkey, Numpad6, on
    Hotkey, Numpad4, on

    Hotkey, !Numpad8, on
    Hotkey, !Numpad2, on
    Hotkey, !Numpad7, on
    Hotkey, !Numpad1, on
    Hotkey, !Numpad9, on
    Hotkey, !Numpad3, on
}
else
{
    Hotkey, *NumPad0, off
    Hotkey, *NumpadIns, off
    Hotkey, *NumPad5, off
    Hotkey, *NumPadDot, off
    Hotkey, *NumPadDel, off
    Hotkey, *NumPadDiv, off
    Hotkey, *NumPadMult, off

    Hotkey, *NumpadSub, off
    Hotkey, *NumpadAdd, off

    Hotkey, *NumPadUp, off
    Hotkey, *NumPadDown, off
    Hotkey, *NumPadLeft, off
    Hotkey, *NumPadRight, off
    Hotkey, *NumPadHome, off
    Hotkey, *NumPadEnd, off
    Hotkey, *NumPadPgUp, off
    Hotkey, *NumPadPgDn, off

    Hotkey, Numpad8, off
    Hotkey, Numpad2, off
    Hotkey, Numpad7, off
    Hotkey, Numpad1, off
    Hotkey, Numpad9, off
    Hotkey, Numpad3, off

    Hotkey, Numpad6, off
    Hotkey, Numpad4, off

    Hotkey, !Numpad8, off
    Hotkey, !Numpad2, off
    Hotkey, !Numpad7, off
    Hotkey, !Numpad1, off
    Hotkey, !Numpad9, off
    Hotkey, !Numpad3, off
}
return

; ¸¶¿ì½º Ŭ¸¯ Áö¿ø

ButtonLeftClick:
GetKeyState, already_down_state, LButton
If already_down_state = D
    return
Button2 = NumPad0
ButtonClick = Left
Goto ButtonClickStart
ButtonLeftClickIns:
GetKeyState, already_down_state, LButton
If already_down_state = D
    return
Button2 = NumPadIns
ButtonClick = Left
Goto ButtonClickStart

ButtonMiddleClick:
GetKeyState, already_down_state, MButton
If already_down_state = D
    return
Button2 = NumPad5
ButtonClick = Middle
Goto ButtonClickStart
ButtonMiddleClickClear:
GetKeyState, already_down_state, MButton
If already_down_state = D
    return
Button2 = NumPadClear
ButtonClick = Middle
Goto ButtonClickStart

ButtonRightClick:
GetKeyState, already_down_state, RButton
If already_down_state = D
    return
Button2 = NumPadDot
ButtonClick = Right
Goto ButtonClickStart
ButtonRightClickDel:
GetKeyState, already_down_state, RButton
If already_down_state = D
    return
Button2 = NumPadDel
ButtonClick = Right
Goto ButtonClickStart

ButtonX1Click:
GetKeyState, already_down_state, XButton1
If already_down_state = D
    return
Button2 = NumPadDiv
ButtonClick = X1
Goto ButtonClickStart

ButtonX2Click:
GetKeyState, already_down_state, XButton2
If already_down_state = D
    return
Button2 = NumPadMult
ButtonClick = X2
Goto ButtonClickStart

ButtonClickStart:
MouseClick, %ButtonClick%,,, 1, 0, D
SetTimer, ButtonClickEnd, 10
return

ButtonClickEnd:
GetKeyState, kclickstate, %Button2%, P
if kclickstate = D
    return

SetTimer, ButtonClickEnd, off
MouseClick, %ButtonClick%,,, 1, 0, U
return

; ¸¶¿ì½º À̵¿ Áö¿ø

ButtonSpeedUp:
MouseSpeed++
ToolTip, Mouse speed: %MouseSpeed% pixels
SetTimer, RemoveToolTip, 1000
return
ButtonSpeedDown:
If MouseSpeed > 1
    MouseSpeed--
If MouseSpeed = 1
    ToolTip, Mouse speed: %MouseSpeed% pixel
else
    ToolTip, Mouse speed: %MouseSpeed% pixels
SetTimer, RemoveToolTip, 1000
return
ButtonAccelerationSpeedUp:
MouseAccelerationSpeed++
ToolTip, Mouse acceleration speed: %MouseAccelerationSpeed% pixels
SetTimer, RemoveToolTip, 1000
return
ButtonAccelerationSpeedDown:
If MouseAccelerationSpeed > 1
    MouseAccelerationSpeed--
If MouseAccelerationSpeed = 1
    ToolTip, Mouse acceleration speed: %MouseAccelerationSpeed% pixel
else
    ToolTip, Mouse acceleration speed: %MouseAccelerationSpeed% pixels
SetTimer, RemoveToolTip, 1000
return

ButtonMaxSpeedUp:
MouseMaxSpeed++
ToolTip, Mouse maximum speed: %MouseMaxSpeed% pixels
SetTimer, RemoveToolTip, 1000
return
ButtonMaxSpeedDown:
If MouseMaxSpeed > 1
    MouseMaxSpeed--
If MouseMaxSpeed = 1
    ToolTip, Mouse maximum speed: %MouseMaxSpeed% pixel
else
    ToolTip, Mouse maximum speed: %MouseMaxSpeed% pixels
SetTimer, RemoveToolTip, 1000
return

ButtonRotationAngleUp:
MouseRotationAnglePart++
If MouseRotationAnglePart >= 8
    MouseRotationAnglePart = 0
MouseRotationAngle = %MouseRotationAnglePart%
MouseRotationAngle *= 45
ToolTip, Mouse rotation angle: %MouseRotationAngle%°
SetTimer, RemoveToolTip, 1000
return
ButtonRotationAngleDown:
MouseRotationAnglePart--
If MouseRotationAnglePart < 0
    MouseRotationAnglePart = 7
MouseRotationAngle = %MouseRotationAnglePart%
MouseRotationAngle *= 45
ToolTip, Mouse rotation angle: %MouseRotationAngle%°
SetTimer, RemoveToolTip, 1000
return

ButtonUp:
ButtonDown:
ButtonLeft:
ButtonRight:
ButtonUpLeft:
ButtonUpRight:
ButtonDownLeft:
ButtonDownRight:
If Button <> 0
{
    IfNotInString, A_ThisHotkey, %Button%
    {
        MouseCurrentAccelerationSpeed = 0
        MouseCurrentSpeed = %MouseSpeed%
    }
}
StringReplace, Button, A_ThisHotkey, *

ButtonAccelerationStart:
If MouseAccelerationSpeed >= 1
{
    If MouseMaxSpeed > %MouseCurrentSpeed%
    {
        Temp = 0.001
        Temp *= %MouseAccelerationSpeed%
        MouseCurrentAccelerationSpeed += %Temp%
        MouseCurrentSpeed += %MouseCurrentAccelerationSpeed%
    }
}

;MouseRotationAngleÀ» ¹öÆ° ¹æÇâÀÇ ¼Óµµ·Î º¯È¯
{
    MouseCurrentSpeedToDirection = %MouseRotationAngle%
    MouseCurrentSpeedToDirection /= 90.0
    Temp = %MouseCurrentSpeedToDirection%

    if Temp >= 0
    {
        if Temp < 1
        {
            MouseCurrentSpeedToDirection = 1
            MouseCurrentSpeedToDirection -= %Temp%
            Goto EndMouseCurrentSpeedToDirectionCalculation
        }
    }
    if Temp >= 1
    {
        if Temp < 2
        {
            MouseCurrentSpeedToDirection = 0
            Temp -= 1
            MouseCurrentSpeedToDirection -= %Temp%
            Goto EndMouseCurrentSpeedToDirectionCalculation
        }
    }
    if Temp >= 2
    {
        if Temp < 3
        {
            MouseCurrentSpeedToDirection = -1
            Temp -= 2
            MouseCurrentSpeedToDirection += %Temp%
            Goto EndMouseCurrentSpeedToDirectionCalculation
        }
    }
    if Temp >= 3
    {
        if Temp < 4
        {
            MouseCurrentSpeedToDirection = 0
            Temp -= 3
            MouseCurrentSpeedToDirection += %Temp%
            Goto EndMouseCurrentSpeedToDirectionCalculation
        }
    }
}
EndMouseCurrentSpeedToDirectionCalculation:

;MouseRotationAngle¸¦ 90µµÀÇ ¼Óµµ·Î ¿À¸¥ÂÊÀ¸·Î º¯È¯
{
    MouseCurrentSpeedToSide = %MouseRotationAngle%
    MouseCurrentSpeedToSide /= 90.0
    Temp = %MouseCurrentSpeedToSide%
    Transform, Temp, mod, %Temp%, 4

    if Temp >= 0
    {
        if Temp < 1
        {
            MouseCurrentSpeedToSide = 0
            MouseCurrentSpeedToSide += %Temp%
            Goto EndMouseCurrentSpeedToSideCalculation
        }
    }
    if Temp >= 1
    {
        if Temp < 2
        {
            MouseCurrentSpeedToSide = 1
            Temp -= 1
            MouseCurrentSpeedToSide -= %Temp%
            Goto EndMouseCurrentSpeedToSideCalculation
        }
    }
    if Temp >= 2
    {
        if Temp < 3
        {
            MouseCurrentSpeedToSide = 0
            Temp -= 2
            MouseCurrentSpeedToSide -= %Temp%
            Goto EndMouseCurrentSpeedToSideCalculation
        }
    }
    if Temp >= 3
    {
        if Temp < 4
        {
            MouseCurrentSpeedToSide = -1
            Temp -= 3
            MouseCurrentSpeedToSide += %Temp%
            Goto EndMouseCurrentSpeedToSideCalculation
        }
    }
}
EndMouseCurrentSpeedToSideCalculation:

MouseCurrentSpeedToDirection *= %MouseCurrentSpeed%
MouseCurrentSpeedToSide *= %MouseCurrentSpeed%

Temp = %MouseRotationAnglePart%
Transform, Temp, Mod, %Temp%, 2

If Button = NumPadUp
{
    if Temp = 1
    {
        MouseCurrentSpeedToSide *= 2
        MouseCurrentSpeedToDirection *= 2
    }

    MouseCurrentSpeedToDirection *= -1
    MouseMove, %MouseCurrentSpeedToSide%, %MouseCurrentSpeedToDirection%, 0, R
}
else if Button = NumPadDown
{
    if Temp = 1
    {
        MouseCurrentSpeedToSide *= 2
        MouseCurrentSpeedToDirection *= 2
    }

    MouseCurrentSpeedToSide *= -1
    MouseMove, %MouseCurrentSpeedToSide%, %MouseCurrentSpeedToDirection%, 0, R
}
else if Button = NumPadLeft
{
    if Temp = 1
    {
        MouseCurrentSpeedToSide *= 2
        MouseCurrentSpeedToDirection *= 2
    }

    MouseCurrentSpeedToSide *= -1
    MouseCurrentSpeedToDirection *= -1

    MouseMove, %MouseCurrentSpeedToDirection%, %MouseCurrentSpeedToSide%, 0, R
}
else if Button = NumPadRight
{
    if Temp = 1
    {
        MouseCurrentSpeedToSide *= 2
        MouseCurrentSpeedToDirection *= 2
    }

    MouseMove, %MouseCurrentSpeedToDirection%, %MouseCurrentSpeedToSide%, 0, R
}
else if Button = NumPadHome
{
    Temp = %MouseCurrentSpeedToDirection%
    Temp -= %MouseCurrentSpeedToSide%
    Temp *= -1
    Temp2 = %MouseCurrentSpeedToDirection%
    Temp2 += %MouseCurrentSpeedToSide%
    Temp2 *= -1
    MouseMove, %Temp%, %Temp2%, 0, R
}
else if Button = NumPadPgUp
{
    Temp = %MouseCurrentSpeedToDirection%
    Temp += %MouseCurrentSpeedToSide%
    Temp2 = %MouseCurrentSpeedToDirection%
    Temp2 -= %MouseCurrentSpeedToSide%
    Temp2 *= -1
    MouseMove, %Temp%, %Temp2%, 0, R
}
else if Button = NumPadEnd
{
    Temp = %MouseCurrentSpeedToDirection%
    Temp += %MouseCurrentSpeedToSide%
    Temp *= -1
    Temp2 = %MouseCurrentSpeedToDirection%
    Temp2 -= %MouseCurrentSpeedToSide%
    MouseMove, %Temp%, %Temp2%, 0, R
}
else if Button = NumPadPgDn
{
    Temp = %MouseCurrentSpeedToDirection%
    Temp -= %MouseCurrentSpeedToSide%
    Temp2 *= -1
    Temp2 = %MouseCurrentSpeedToDirection%
    Temp2 += %MouseCurrentSpeedToSide%
    MouseMove, %Temp%, %Temp2%, 0, R
}

SetTimer, ButtonAccelerationEnd, 10
return

ButtonAccelerationEnd:
GetKeyState, kstate, %Button%, P
if kstate = D
    Goto ButtonAccelerationStart

SetTimer, ButtonAccelerationEnd, off
MouseCurrentAccelerationSpeed = 0
MouseCurrentSpeed = %MouseSpeed%
Button = 0
return

; ¸¶¿ì½º ÈÙ À̵¿ Áö¿ø

ButtonWheelSpeedUp:
MouseWheelSpeed++
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
MouseWheelSpeedReal = %MouseWheelSpeed%
MouseWheelSpeedReal *= %MouseWheelSpeedMultiplier%
ToolTip, Mouse wheel speed: %MouseWheelSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return
ButtonWheelSpeedDown:
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
If MouseWheelSpeedReal > %MouseWheelSpeedMultiplier%
{
    MouseWheelSpeed--
    MouseWheelSpeedReal = %MouseWheelSpeed%
    MouseWheelSpeedReal *= %MouseWheelSpeedMultiplier%
}
If MouseWheelSpeedReal = 1
    ToolTip, Mouse wheel speed: %MouseWheelSpeedReal% line
else
    ToolTip, Mouse wheel speed: %MouseWheelSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return

ButtonWheelAccelerationSpeedUp:
MouseWheelAccelerationSpeed++
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
MouseWheelAccelerationSpeedReal = %MouseWheelAccelerationSpeed%
MouseWheelAccelerationSpeedReal *= %MouseWheelSpeedMultiplier%
ToolTip, Mouse wheel acceleration speed: %MouseWheelAccelerationSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return
ButtonWheelAccelerationSpeedDown:
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
If MouseWheelAccelerationSpeed > 1
{
    MouseWheelAccelerationSpeed--
    MouseWheelAccelerationSpeedReal = %MouseWheelAccelerationSpeed%
    MouseWheelAccelerationSpeedReal *= %MouseWheelSpeedMultiplier%
}
If MouseWheelAccelerationSpeedReal = 1
    ToolTip, Mouse wheel acceleration speed: %MouseWheelAccelerationSpeedReal% line
else
    ToolTip, Mouse wheel acceleration speed: %MouseWheelAccelerationSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return

ButtonWheelMaxSpeedUp:
MouseWheelMaxSpeed++
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
MouseWheelMaxSpeedReal = %MouseWheelMaxSpeed%
MouseWheelMaxSpeedReal *= %MouseWheelSpeedMultiplier%
ToolTip, Mouse wheel maximum speed: %MouseWheelMaxSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return
ButtonWheelMaxSpeedDown:
RegRead, MouseWheelSpeedMultiplier, HKCU, Control Panel\Desktop, WheelScrollLines
If MouseWheelSpeedMultiplier <= 0
    MouseWheelSpeedMultiplier = 1
If MouseWheelMaxSpeed > 1
{
    MouseWheelMaxSpeed--
    MouseWheelMaxSpeedReal = %MouseWheelMaxSpeed%
    MouseWheelMaxSpeedReal *= %MouseWheelSpeedMultiplier%
}
If MouseWheelMaxSpeedReal = 1
    ToolTip, Mouse wheel maximum speed: %MouseWheelMaxSpeedReal% line
else
    ToolTip, Mouse wheel maximum speed: %MouseWheelMaxSpeedReal% lines
SetTimer, RemoveToolTip, 1000
return

ButtonWheelUp:
ButtonWheelDown:

If Button <> 0
{
    If Button <> %A_ThisHotkey%
    {
        MouseWheelCurrentAccelerationSpeed = 0
        MouseWheelCurrentSpeed = %MouseWheelSpeed%
    }
}
StringReplace, Button, A_ThisHotkey, *

ButtonWheelAccelerationStart:
If MouseWheelAccelerationSpeed >= 1
{
    If MouseWheelMaxSpeed > %MouseWheelCurrentSpeed%
    {
        Temp = 0.001
        Temp *= %MouseWheelAccelerationSpeed%
        MouseWheelCurrentAccelerationSpeed += %Temp%
        MouseWheelCurrentSpeed += %MouseWheelCurrentAccelerationSpeed%
    }
}

If Button = NumPadSub
    MouseClick, wheelup,,, %MouseWheelCurrentSpeed%, 0, D
else if Button = NumPadAdd
    MouseClick, wheeldown,,, %MouseWheelCurrentSpeed%, 0, D

SetTimer, ButtonWheelAccelerationEnd, 100
return

ButtonWheelAccelerationEnd:
GetKeyState, kstate, %Button%, P
if kstate = D
    Goto ButtonWheelAccelerationStart

MouseWheelCurrentAccelerationSpeed = 0
MouseWheelCurrentSpeed = %MouseWheelSpeed%
Button = 0
return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return