记录一下,
windows用autohotkeys
crtl + 方向键 / 空格 :移动鼠标 / 鼠标左击
crtl + shift + 方向键 / 空格: 快速移动鼠标 / 鼠标右击
^up::MouseMove,0,-75,0,r
^+up::MouseMove,0,-15,0,r
^down::MouseMove,0,75,0,r
^+down::MouseMove,0,15,0,r
^left::mousemove,-75,0,0,r
^+left::mousemove,-15,0,0,r
^right::mousemove,75,0,0,r
^+right::mousemove,15,0,0,r
^space::MouseClick, left
^+space::MouseClick, right
mac用hammerspoon ,这个还没做好,无法长按实现持续移动,鼠标点击也还没做,先用着
-- alt + 方向键 :移动鼠标 --
-- alt + cmd + 方向键:快速移动鼠标 --
-- alt + space :鼠标左击 --local screens = hs.screen.allScreens()function moveleft()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"]-100, y=cs["y"] + 0}, screens[1])
endfunction moveleft_accurate()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"]-10, y=cs["y"] + 0}, screens[1])
endfunction moveright()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"]+100, y=cs["y"] + 0}, screens[1])
endfunction moveright_accurate()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"]+10, y=cs["y"] + 0}, screens[1])
endfunction moveup()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"], y=cs["y"]-100}, screens[1])
endfunction moveup_accurate()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"], y=cs["y"]-10}, screens[1])
endfunction movedown()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"], y=cs["y"]+100}, screens[1])
endfunction movedown_accurate()local cs = hs.mouse.getRelativePosition()hs.mouse.setRelativePosition({x= cs["x"], y=cs["y"]+10}, screens[1])
endfunction MouseleftClick()local cs = hs.mouse.getRelativePosition()hs.eventtap.leftClick(cs)
endfunction MouseRightClick()local cs = hs.mouse.getRelativePosition()hs.eventtap.RightClick(cs)
endhs.hotkey.bind({"alt"}, "Left", moveleft)
hs.hotkey.bind({"alt","cmd"}, "Left", moveleft_accurate)
hs.hotkey.bind({"alt"}, "Right", moveright)
hs.hotkey.bind({"alt","cmd"}, "Right", moveright_accurate)
hs.hotkey.bind({"alt"}, "Up", moveup)
hs.hotkey.bind({"alt","cmd"}, "Up", moveup_accurate)
hs.hotkey.bind({"alt"}, "Down", movedown)
hs.hotkey.bind({"alt","cmd"}, "Down", movedown_accurate)
hs.hotkey.bind({"alt"}, "Space", MouseleftClick)