info(“mouse”)

The info(“mouse”) function returns the current location of the mouse in screen relative coordinates.


Description

This function returns the current location of the mouse in screen relative coordinates.

The example below calculates the distance (in inches) and angle between the current mouse position and the point where the mouse was last clicked.

local dragDistance, dragAngle,mousePoint,deltaV,deltaH
mousePoint=info("mouse")
deltaV=v(mousePoint-v( info("click")))
deltaH=h(mousePoint-h( info("click")))
dragDistance=sqr(deltaV^2+deltaH^2)/72
dragAngle=arctan(deltaV/deltaH)*180/pi()

Notes: The second line copies the current mouse position into the variable mousePoint. This is necessary in case the mouse moves between the third and fourth lines of the procedure. The division by 72 at the end of the dragDistance calculation converts the distance to inches. The multiplication by 180/p in the angle calculation converts the angle from radians to degrees.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0