next up previous contents index
Next: Some examples of usage: Up: Receiving input from the Previous: Some examples of usage:   Contents   Index

Interact with the mouse

Currently, mouse events can be accepted from the user during program execution via three primitives: readmouse, mousepos and mouse?.

readmouse: the program is paused until the user presses the mouse. Then, it returns a number that represents the event.

These are the differents values:
0$ \to$The mouse has moved
1$ \to$The button 1 has been pressed
2$ \to$The button 2 has been pressed
...
The button 1 is the left button , the button 2 is the next on the right ...

mousepos, mouseposition: Returns a list that contains the position of the mouse.

, mouse?: Returns true if we touch the mouse since the program begins. Returns false otherwise.



Loïc 2008-06-08