鼠标手势.ahk 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. ; @Author : liuyuqi
  2. ; @Contact : liuyuqi.gov@msn.cn
  3. ; @Time : 2019/08/05 07:06:02
  4. ; @Version : 1.0
  5. ; @License : (C)Copyright 2019 liuyuqi.
  6. ; @Desc : 鼠标手势
  7. rbutton::
  8. minGap = 30 ; 设定的识别阈值,大于此阈值,说明在某方向上有移动
  9. mousegetpos xpos1,ypos1
  10. Keywait, RButton, U
  11. mousegetpos xpos2, ypos2
  12. if (abs(xpos1-xpos2) < minGap and abs(ypos1-ypos2)<minGap) ; nothing 没有运动,直接输出rbutton
  13. send, {rbutton}
  14. else if (xpos1-xpos2 > minGap and abs(ypos1-ypos2)<minGap) ; left delete(对于文件或选定的字符有效)
  15. send, {delete}
  16. else if (xpos2-xpos1 > minGap and abs(ypos1-ypos2)<minGap) ; right ctrl+z 恢复
  17. send, ^z
  18. else if (abs(xpos1-xpos2)< minGap and (ypos1-ypos2)>minGap) ; up 最大化窗口, win+up
  19. send, #{up}
  20. else if (abs(xpos1-xpos2)< minGap and (ypos2-ypos1)>minGap) ; down 显示桌面, win+d
  21. send, #d
  22. else if (ypos2-ypos1 > minGap and (xpos1-xpos2) > minGap) ; down and left , ctrl+shift+T
  23. send, ^+t
  24. else if (ypos2-ypos1 > minGap and (xpos2-xpos1) > minGap) ; down and right, ctrl+w
  25. send, ^w
  26. else if (ypos1-ypos2 > minGap and (xpos2-xpos1) > minGap) ; up and right alt+f4
  27. send, !{F4}
  28. else if (ypos1-ypos2 > minGap and (xpos1-xpos2) > minGap) ; up and left nothing
  29. send, {rbutton}
  30. else
  31. send, {rbutton}
  32. return