Current position of the mouse

mousepos

Returns 2-element array of coordinates, {x y}, that contains current position of the mouse in the graphics window. If the mouse is outside the window, then returns the last position which was inside the window.

Example:

"t := timer [print mousepos] 500

Output (move the mouse over the graphics window):

{-16 88}
{65 16}
{6 -44}
{-67 -20}
{-54 31}
...

See also:

Table of Content