#include <IsPressedEx.au3>
HotKeySet("^q", "_Quit")
$hU32_DllOpen = DllOpen("User32.dll")
global $sTT_Data1 = MouseGetPos()
While 1
$iRet = _IsPressedEx("{LMOUSE}", $hU32_DllOpen, 1, 1)
If $iRet Then _Output_IsPressedEx_Result($iRet, @Extended)
IF not $iRet Then $sTT_Data1=MouseGetPos()
Sleep(10)
WEnd
Func _Output_IsPressedEx_Result($iRet, $iExtended)
Local $sTT_Data = MouseGetPos()
ToolTip("X= "& $sTT_Data[0]-$sTT_Data1[0] & @CRLF&"Y= " &$sTT_Data[1]-$sTT_Data1[1])
EndFunc
Func _Quit()
DllClose($hU32_DllOpen)
Exit
EndFunc