BUTTON?

Syntax

BUTTON? 1, 2 or 3

Explanation

BUTTON? outputs the state of the left or right mouse button. The number given as its input is 1 for the left button, 2 for the right button or 3 for the middle button. The output is TRUE when the button is depressed, or FALSE when the button is not depressed or when no mouse is found.

See also MOUSE and .MOUSEON.

Example

TO CHECK.MOUSE


 * IF BUTTON? 1 THEN PRINT [LEFT BUTTON WAS PRESSED.]


 * IF BUTTON? 2 THEN PRINT [RIGHT BUTTON WAS PRESSED.]


 * CHECK.MOUSE

END

Use Control G to stop this procedure.