自动热键滚动功能

Dan*_*iel 3 autohotkey scrolling

我最近得到了一个没有滚动选项的轨迹球。我不知道这是否可行,但是有没有办法检测在按下某个键时轨迹球是否正在移动(比如说 alt 键),停止鼠标移动并根据轨迹球的方向滚动?

我找到了一种方法来检测光标位置的变化而不是鼠标位置的变化。我也没有找到阻止光标移动的方法。

你能帮我吗?

Ell*_*olf 5

我在 AutoHotkey 论坛上找到了这个并将其修改为包括水平滚动。按住 alt 并移动鼠标将在鼠标移动的方向上执行滚动。

~*Alt::
    Loop
    {
       If !GetKeyState("Alt","P")
          break
       MouseGetPos, ax,ay
       Sleep, 50
       MouseGetPos,bx,by
       Send % (ay<by ? "{WheelDown " : "{WheelUp ") . round(Abs(ay-by)/(GetKeyState("Shift","P") ? 10 : 1)) . "}"
       Send % (ax<bx ? "{WheelRight " : "{WheelLeft ") . round(Abs(ax-bx)/(GetKeyState("Shift","P") ? 10 : 1)) . "}"
    }
Return
Run Code Online (Sandbox Code Playgroud)

来源