The global "mouse" is non-nil when a working mouse is attached to the computer. The x and y axes of the mouse represent the system cursor location. The origin of the cursor (0, 0) is the center of the game window, not its top-left corner. Moving the mouse cursor up increases its y-axis value and moving it right increases its x-axis value. Remember that the cursor position is measured in display resolution pixels. If the cursor is moved to the left end of the window, it would have an x-axis value of negative half the resolution width even if the window is resized.

Figure 1: Mouse cursor positions in an 800 by 600 window

Unlike the x and y axes, the z-axis of the mouse does not have an absolute position. Instead, you will be notified of its relative change in notches through the "on_wheelmove" event.

Predefined Buttons