1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| SetScrollLockState, AlwaysOff;禁用SetScrollLockState #SingleInstance count = 0 JoyMultiplier = 0.20 JoyThreshold = 3 JoyThresholdUpper := 50 + JoyThreshold JoyThresholdLower := 50 - JoyThreshold YAxisMultiplier = -1 SetTimer, WatchKeyboard, 10
Hotkey, F1, ButtonLeft ;F1模拟左键 Hotkey, F2, ButtonRight;F2模拟右键 Hotkey, up, empty Hotkey, down, empty Hotkey, left, empty Hotkey, right, empty Return
ScrollLock & F1:: ;开启鼠标功能 SetTimer, WatchKeyboard, 10 Hotkey, F1, On Hotkey, F2, On Hotkey, up, On Hotkey, down, On Hotkey, left, On Hotkey, right, On Return
ScrollLock & F2::;关闭鼠标功能 SetTimer, WatchKeyboard, Off Hotkey, F1, Off Hotkey, F2, Off Hotkey, up, Off Hotkey, down, Off Hotkey, left, Off Hotkey, right, Off Return
empty: Return WatchKeyboard: MouseNeedsToBeMoved := false ; Set default. JoyMultiplier+=0.01 SetFormat, float, 03 up:=GetKeyState("Up","p") down:=GetKeyState("Down","p") Left:=GetKeyState("Left","p") right:=GetKeyState("Right","p") if(Right) { MouseNeedsToBeMoved := true DeltaX := 10 } else if(Left) { MouseNeedsToBeMoved := true DeltaX := -10 } else DeltaX = 0 if (up) { MouseNeedsToBeMoved := true DeltaY := 10 } else if (Down) { MouseNeedsToBeMoved := true DeltaY := -10 } else DeltaY = 0 if MouseNeedsToBeMoved { SetMouseDelay, -1 ; Makes movement smoother. MouseMove, DeltaX * JoyMultiplier, DeltaY * JoyMultiplier * YAxisMultiplier, 0, R } Else count++ If(count>20){ JoyMultiplier = 0.30 count=0 } return
ButtonLeft: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left,,, 1, 0, D ; Hold down the left mouse button. SetTimer, WaitForLeftButtonUp, 10 return
ButtonRight: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, right,,, 1, 0, D ; Hold down the right mouse button. SetTimer, WaitForRightButtonUp, 10 return
WaitForLeftButtonUp:;使用支持鼠标手势 if GetKeyState("F1") return ; The button is still, down, so keep waiting. ; Otherwise, the button has been released. SetTimer, WaitForLeftButtonUp, off SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left,,, 1, 0, U ; Release the mouse button. return
WaitForRightButtonUp: if GetKeyState("F2") return ; The button is still, down, so keep waiting. ; Otherwise, the button has been released. SetTimer, WaitForRightButtonUp, off MouseClick, right,,, 1, 0, U ; Release the mouse button. return ;;endmouse
|