分享一套我现在在使用Autohotkey的脚本

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                          ||
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值