6 Struct N_GUI_MOUSE_EVENT
gullradriel edited this page 2026-10-12 07:59:13 +02:00

N_GUI_MOUSE_EVENT

Module: GUI: allegro5 widget system with pseudo-windows

A mouse event handed to a custom widget, in the widget's own coordinates.

#include "n_gui.h"

Public Attributes

Name
float y
pointer y from the widget's top edge; outside 0..h during a DRAG
float x
pointer x from the widget's left edge; outside 0..w during a DRAG
int type
N_GUI_MOUSE_DOWN, _UP, _MOVE, _DRAG or _WHEEL.
int modifiers
the modifier keys held when the event came, ALLEGRO_KEYMOD_SHIFT, _CTRL, _ALT and _ALTGR ORed, as n_gui_get_key_modifiers() says.
int dz
wheel steps for WHEEL, positive away from the user; 0 otherwise
int button
1 left, 2 right for DOWN; 1 for UP and DRAG; 0 otherwise

Public Attributes Documentation

variable y

float y;

pointer y from the widget's top edge; outside 0..h during a DRAG

variable x

float x;

pointer x from the widget's left edge; outside 0..w during a DRAG

variable type

int type;

N_GUI_MOUSE_DOWN, _UP, _MOVE, _DRAG or _WHEEL.

variable modifiers

int modifiers;

the modifier keys held when the event came, ALLEGRO_KEYMOD_SHIFT, _CTRL, _ALT and _ALTGR ORed, as n_gui_get_key_modifiers() says.

Allegro's mouse events carry none, so this is what a custom widget reads to tell Ctrl+wheel from the wheel

variable dz

int dz;

wheel steps for WHEEL, positive away from the user; 0 otherwise

variable button

int button;

1 left, 2 right for DOWN; 1 for UP and DRAG; 0 otherwise