next up previous contents index
Next: System Command Interface Up: Operating System and Input/Output Previous: Menu Buttons   Contents   Index

Mouse Input

(int) Point(array)
The argument is the name of a two component (or larger) array. This function blocks until a mouse button is pressed, or the Esc key is pressed, while the pointer is in a drawing window. The coordinates of the pointer at the time of the press are returned in the array. The return value is 0 if Esc was pressed, 1 for button 1, 2 for button 2, etc.
Example:
a[2]
ShowPrompt("Click in a drawing window")
Point(a)
ShowPrompt("x=", a[0], "y=", a[1])

When a ghost image is displayed with the ShowGhost function, the coordinates returned are either snapped to the grid or not, depending on the mode number passed to ShowGhost. If no ghost image is displayed, the nearest grid point is returned.

If the UseTransform function has been called to enable use of the current transform, the current transform will be applied to the displayed objects when using mode 8. The translation supplied to UseTransform is ignored (the translation tracks the mouse pointer).



Stephen R. Whiteley 2006-10-23