Code: Select all
Procedure MouseMoveX()
Static lastx
Static callflag
If Not callflag ; if this procedure has not been called before
callflag=1
lastx=DesktopMouseX()
ProcedureReturn 0
EndIf
n=lastx
lastx=DesktopMouseX()
ProcedureReturn DesktopMouseX()-n
EndProcedure
Procedure MouseMoveY()
Static lasty
Static callflag
If Not callflag ; if this procedure has not been called before
callflag=1
lasty=DesktopMouseY()
ProcedureReturn 0
EndIf
n=lasty
lasty=DesktopMouseY()
ProcedureReturn DesktopMouseY()-n
EndProcedure
Repeat
If GetAsyncKeyState_(#VK_LBUTTON)&32768
n=MouseMoveX()
If n<>0
Debug n
EndIf
n=MouseMoveY()
If n<>0
Debug n
EndIf
EndIf
Delay(20)
ForEver