libtcoddocumentation

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;

ParameterDescription
x,yAbsolute position of the mouse cursor in pixels relative to the window top-left corner.
dx,dyMovement of the mouse cursor since the last call in pixels.
cx,cyCoordinates of the console cell under the mouse cursor (pixel coordinates divided by the font size).
dcx,dcyMovement of the mouse since the last call in console cells (pixel coordinates divided by the font size).
lbuttontrue if the left button is pressed.
rbuttontrue if the right button is pressed.
mbuttontrue if the middle button (or the wheel) is pressed.
lbutton_pressedtrue if the left button was pressed and released.
rbutton_pressedtrue if the right button was pressed and released.
mbutton_pressedtrue if the middle button was pressed and released.
wheel_uptrue if the wheel was rolled up.
wheel_downtrue if the wheel was rolled down.