next up previous contents index
Next: Graphical Input Up: Main Functions 2 Previous: Menu Buttons   Contents   Index

Mouse Input

(int) Point(array)
This function blocks until mouse button 1 (left 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 or 1 for a button 1 press. Buttons 2 and 3 have their normal effects while this function is active, i.e., they are not handled in this function.

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).

(int) Selection()
Block, but allow selections in drawing windows. Return on any keypress, or escape event. Return the number of selected objects in the selection list.


next up previous contents index
Next: Graphical Input Up: Main Functions 2 Previous: Menu Buttons   Contents   Index
Stephen R. Whiteley 2017-04-09