SetCapsLockState, AlwaysOff
;***************************模拟鼠标控制*****************************
;|+=======================================================+|
;|| ||
;|+-------------------------+-----------------------------+|
;|| CapsLock+d | 开启 ||
;|| CapsLock+f | 关闭 ||
;|| | ||
;|+-------------------------+-----------------------------+|
;|| d | 左键 ||
;|| f | 右键 ||
;|| ikjl | 鼠标移动 ||
;|+=======================================================+|
#SingleInstance
count = 0
JoyMultiplier = 0.20
JoyThreshold = 3
JoyThresholdUpper := 50 + JoyThreshold
JoyThresholdLower := 50 - JoyThreshold
YAxisMultiplier = -1
SetTimer, WatchKeyboard, 10
Hotkey, d, ButtonLeft
Hotkey, f, ButtonRight
Hotkey, i,empty
Hotkey, k,empty
Hotkey, j,empty
Hotkey, l,empty
Return
CapsLock & d::
SetTimer, WatchKeyboard,10
Hotkey, d, On
Hotkey, f, On
Hotkey, i, On
Hotkey, k, On
Hotkey, j, On
Hotkey, l, On
Return
CapsLock & f::
SetTimer, WatchKeyboard, Off
Hotkey, d, Off
Hotkey, f, Off
Hotkey, i, Off
Hotkey, k, Off
Hotkey, j, Off
Hotkey, l, Off
Return
empty:
Return
WatchKeyboard:
MouseNeedsToBeMoved := false ; Set default.
JoyMultiplier+=0.01
SetFormat, float, 03
i:=GetKeyState("i","p")
k:=GetKeyState("k","p")
j:=GetKeyState("j","p")
l:=GetKeyState("l","p")
if(l)
{
MouseNeedsToBeMoved := true
DeltaX := 10
}
else if(j)
{
MouseNeedsToBeMoved := true
DeltaX := -10
}
else
DeltaX = 0
if (i)
{
MouseNeedsToBeMoved := true
DeltaY := 10
}
else if (k)
{
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("d")
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("f")
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
;/*****************在非代码编辑器内实现括号补全*****************************/
;|+=======================================================+|
;|| 热键 caps + 9 ||
分享一套我现在在使用Autohotkey的脚本
最新推荐文章于 2024-08-03 12:39:07 发布