Next: Getting the events, Previous: Interfacing with the mouse, Up: Interfacing with the mouse [Contents][Index]
Before you do anything else, the events you want to receive have to be
enabled with mousemask
. You pass it a bit mask of events you
would like to listen. By default, all the events are turned off. The
bit mask ALL_MOUSE_EVENTS
can be used to get all the events.
For current technology, the following events are of use.
Name | Description |
---|---|
BUTTON1_PRESSED | mouse button 1 down |
BUTTON1_RELEASED | mouse button 1 up |
BUTTON1_CLICKED | mouse button 1 clicked |
BUTTON1_DOUBLE_CLICKED | mouse button 1 double clicked |
BUTTON2_PRESSED | mouse button 2 down |
BUTTON2_RELEASED | mouse button 2 up |
BUTTON2_CLICKED | mouse button 2 clicked |
BUTTON2_DOUBLE_CLICKED | mouse button 2 double clicked |
BUTTON_SHIFT | shift was down during button state change |
BUTTON_CTRL | control was down during button state change |
BUTTON_ALT | alt was down during button state change |
ALL_MOUSE_EVENTS | report all button state changes |
REPORT_MOUSE_POSITION | report mouse movement |
There similar constants for mouse button #3 and #4.
There are some important things to note.
BUTTON_SHIFT
, BUTTON_ALT
, and
BUTTON_CTRL
codes will probably not work, as they will
probably be intercepted by the window manager.