info(“mouse”)
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.

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

Notes: The first line copies the current mouse position into the variable mousePoint. This is necessary in case the mouse moves between the second and third 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

- info("modifiers") -- returns the status of the modifier keys.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0