; 鼠标手势
rbutton::
minGap = 30 ; 设定的识别阈值,大于此阈值,说明在某方向上有移动
minAng:=30
xpos:=[]
ypos:=[]
Counts:=1
loop
{
mousegetpos,Txpos, Typos
if(A_Index!=1)
{
if(Txpos=xpos[1])
{
continue
}
else
{
Counts+=1
}
}
xpos[Counts] :=Txpos
;ToolTip,% xpos.Length()
ypos[Counts]:=Typos
Sleep 10
;ToolTip,% GetKeyState("RButton","p")
if !GetKeyState("RButton","p")
{
break
}
}
;Keywait, RButton, U
;mousegetpos xpos2, ypos2
;~ loop,% xpos.Length()
;~ {
;~ MsgBox,% xpos[A_Index]
;~ }
MsgBox,% ypos[ypos.Length()]-ypos[1]
MsgBox,% ATan((xpos[2]-xpos[1])/(ypos[2]-ypos[1]))*57.29578
if ((abs(xpos[1]-xpos[xpos.Length()]) minGap and abs(ypos1-ypos2) minGap and abs(ypos1-ypos2)minGap) ; 上↑↑: 最大化窗口, win+up
;~ send, #{up}
;~ else if (abs(xpos1-xpos2)minGap) ; 下↓↓:最下化窗口, win+d
;~ send,!{Space}n;~ else if (ypos2-ypos1 > minGap and (xpos1-xpos2) > minGap) ; 左下:显示桌面
;~ send, #d
else if (ypos[ypos.Length()]-ypos[1] > minGap and xpos[xpos.Length()]-xpos[1] > minGap and Abs(ATan((xpos[2]-xpos[1])/(ypos[2]-ypos[1]))) minGap and (xpos2-xpos1) > minGap) ; 右上:关闭窗口 alt+f4
;~ send, !{F4}
;~ else if (ypos1-ypos2 > minGap and (xpos1-xpos2) > minGap) ; 左上:右键操作 鼠标右键
;~ Send,#1
;~ else
;~ send, {rbutton}return
;-------------------------------------------MouseV1.0-------------------------
;~ RButton::
;~ MouseGetPos x0, y0
;~ SetTimer, getTrack, 10
;~ KeyWait, RButton
;~ SetTimer, getTrack, off
;~ StringLen slen, dir
;~ if (slen >0 && slen=abs(x1-x0))?(y1SubStr(dir, 0, 1)) and (abs(y1-y0)>10 or abs(x1-x0)>10)
;~ dir .= tdir
;~ x0 := x1
;~ y0 := y1
;~ return
;~ M-DL:
;~ Send {Browser_Back}
;~ return
;~ M-DR:
;~ Send {Browser_Forward}
;~ return
;~ M-LU:
;~ send ^{c}
;~ command = "已复制"
;~ return
;~ M-LD:
;~ Send ^{v}
;~ command = "已粘贴"
;~ return
;~ M-U:
;~ M-D:
;~ M-R:
;~ M-L:
;~ M-UD:
;~ M-UL:
;~ M-UR:
;~ M-DU:
;~ M-RU:
;~ M-RD:
;~ M-RL:
;~ M-LR:
;~ return