2.4.5. Mouse event structure
This tructure contains information about a mouse move/press/release event.
typedef struct {
int x,y;
int dx,dy;
int cx,cy;
int dcx,dcy;
bool lbutton;
bool rbutton;
bool mbutton;
bool lbutton_pressed;
bool rbutton_pressed;
bool mbutton_pressed;
bool wheel_up;
bool wheel_down;
} TCOD_mouse_t;
Parameter | Description |
---|---|
x,y | Absolute position of the mouse cursor in pixels relative to the window top-left corner. |
dx,dy | Movement of the mouse cursor since the last call in pixels. |
cx,cy | Coordinates of the console cell under the mouse cursor (pixel coordinates divided by the font size). |
dcx,dcy | Movement of the mouse since the last call in console cells (pixel coordinates divided by the font size). |
lbutton | true if the left button is pressed. |
rbutton | true if the right button is pressed. |
mbutton | true if the middle button (or the wheel) is pressed. |
lbutton_pressed | true if the left button was pressed and released. |
rbutton_pressed | true if the right button was pressed and released. |
mbutton_pressed | true if the middle button was pressed and released. |
wheel_up | true if the wheel was rolled up. |
wheel_down | true if the wheel was rolled down. |