' ================================================
'  This example demonstrates MouseX, MouseY
'  and the KeyPressed events and conditions
' ------------------------------------------------
'  Start and reset the zero position with key "X"
'  Stop with key "Z"
' ================================================

Key X Gosub JOG
Stop

Variable Numeric Jog_X
Variable Numeric Jog_Y
Variable Numeric Jog_MouseStartX
Variable Numeric Jog_MouseStartY

Label JOG
	Jog_MouseStartX = MouseX
	Jog_MouseStartY = MouseY
	Label Jog2
		Jog_X = MouseX - Jog_MouseStartX
		Jog_Y = MouseY - Jog_MouseStartY
		Print Format(Jog_X, "0.000") + " " + Format(Jog_Y, "0.000")
		If Key("Z")
			Wait Not Key("Z")
			Return
		EndIf
	Goto Jog2
Return


'WATCH v1
'WATCH GetSeparatedString(SequenceCmd, 1)
