Try something like this. It uses the Windows GetCursor library funtion to test the cursor and compare it to the cursors previous state.
Code: Select all
LibFunc>user32,GetCursor,InitialCursor
//Move mouse in a circle
MouseMove>875,263
Wait>2
GoSub>TestCursor
MouseMove>922,293
Wait>2
GoSub>TestCursor
MouseMove>952,314
Wait>2
GoSub>TestCursor
MouseMove>918,303
Wait>2
GoSub>TestCursor
MouseMove>881,351
Wait>2
GoSub>TestCursor
MouseMove>845,318
Wait>2
GoSub>TestCursor
MouseMove>800,307
Wait>2
GoSub>TestCursor
MouseMove>836,279
SRT>TestCursor
LibFunc>user32,GetCursor,CursorNow
If>CursorNow<>InitialCursor
MDL>Cursor has changed from %InitialCursor% to %CursorNow%
Let>InitialCursor=CursorNow
EndIf
END>TestCursor
BTW, as posted, the "Move mouse in a circle" positions are not very circular.
How about something like this:
The soubroutine allows parameters to be passed that specify the centerpoint of the circle, the degrees of arc to use, and either the number of points in the arc or the angle between points in the arc.
Code: Select all
LibFunc>user32,GetCursor,InitialCursor
Let>up_down=1
//Usage:
//GoSub>GoAround,radius,arc length(+ CW or - CCW),angle between points,Center X,Center Y,[number of points (circumvents angle between points)]
GoSub>GoAround,80,-345,15,300,300
GoSub>GoAround,110,360,45,300,300
GoSub>GoAround,110,35,45,300,300,7
SRT>GoAround
Let>radius=GoAround_var_1
Let>ArcLength={%GoAround_var_2%*(pi/180)}
Let>FocusX=GoAround_var_4
Let>FocusY=GoAround_var_5
Assigned>GoAround_var_6,AsgRes
If>AsgRes=FALSE
Let>GoAround_var_6=0
EndIf
If>{(%AsgRes%="TRUE")and(%GoAround_var_6%>0)}
Let>DeltaAngle={%GoAround_var_2%/(%GoAround_var_6%-1)}
Let>GoAround_var_6=0
Else
Let>DeltaAngle=GoAround_var_3
If>{(%ArcLength%<0)and(%DeltaAngle%>0)}
Let>DeltaAngle={%DeltaAngle%*-1}
EndIf
EndIf
Let>angle=0
Label>GoAroundStart
Let>NextAngle={%angle%*(pi/180)}
Let>NewXOff={(cos(%NextAngle%))*%Radius%}
Let>NewYOff={(sin(%NextAngle%))*%Radius%}
Let>NewX={round(%FocusX%-%NewXOff%)}
Let>NewY={round(%FocusY%-%NewYOff%)}
MouseMove>%NewX%,%NewY%
Add>angle,%DeltaAngle%
GoSub>TestCursor
Wait>0.5
Let>Delta={(%ArcLength%-%Nextangle%)}
If>ArcLength>0
If>Delta>0.001
Goto>GoAroundStart
EndIf
Else
If>Delta<-0.001
Goto>GoAroundStart
EndIf
EndIf
END>GoAround
SRT>TestCursor
LibFunc>user32,GetCursor,CursorNow
If>CursorNow<>InitialCursor
MDL>Cursor has changed from %InitialCursor% to %CursorNow%
/*
If>up_down=1
LDown
Let>up_down=0
Else
Lup
Let>up_down=1
EndIf
*/
Let>InitialCursor=CursorNow
EndIf
END>TestCursor