The following functions handle various mouse events.
The first group handles mouse events which happen inside a specific GUI object (e.g., display, circle, etc.):
Function | Description |
object.onMouseClick(function) | When the user clicks the mouse (left button), the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
object.onMouseDown(function) | When the user presses the left mouse button, the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
object.onMouseUp(function) | When the user releases the left mouse button, the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
object.onMouseMove(function) | When the user moves the mouse within the object, the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
object.onMouseDrag(function) | When the user drags the mouse within the object (i.e., moves the mouse while clicking), the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
The following functions handle movement of mouse that crosses the borders of a GUI object (i.e., entering or exiting the object boundaries):
Function | Description |
object.onMouseEnter(function) | When the user moves the mouse into the borders of an object (from outside), the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |
object.onMouseExit(function) | When the user moves the mouse from inside to outside the borders of an object, the system calls the provided function. This function should accept two parameters, x and y (i.e., the coordinates of the mouse cursor). |