2024-01-24 20:36:24 +01:00
|
|
|
/// A mouse event
|
|
|
|
pub const Mouse = @This();
|
|
|
|
|
|
|
|
pub const Shape = enum {
|
|
|
|
default,
|
|
|
|
text,
|
|
|
|
pointer,
|
|
|
|
help,
|
|
|
|
progress,
|
|
|
|
wait,
|
|
|
|
@"ew-resize",
|
|
|
|
@"ns-resize",
|
|
|
|
cell,
|
|
|
|
};
|
2024-01-31 14:31:27 +01:00
|
|
|
|
2024-01-31 19:50:00 +01:00
|
|
|
pub const Button = enum(u8) {
|
|
|
|
left,
|
|
|
|
middle,
|
|
|
|
right,
|
|
|
|
none,
|
|
|
|
wheel_up = 64,
|
|
|
|
wheel_down = 65,
|
|
|
|
button_8 = 128,
|
|
|
|
button_9 = 129,
|
|
|
|
button_10 = 130,
|
|
|
|
button_11 = 131,
|
|
|
|
};
|
|
|
|
|
|
|
|
pub const Modifiers = packed struct(u3) {
|
|
|
|
shift: bool = false,
|
|
|
|
alt: bool = false,
|
|
|
|
ctrl: bool = false,
|
|
|
|
};
|
|
|
|
|
|
|
|
pub const Type = enum {
|
|
|
|
press,
|
|
|
|
release,
|
|
|
|
motion,
|
|
|
|
drag,
|
|
|
|
};
|
|
|
|
|
|
|
|
col: usize,
|
|
|
|
row: usize,
|
2024-05-22 20:56:00 +02:00
|
|
|
xoffset: usize = 0,
|
|
|
|
yoffset: usize = 0,
|
2024-01-31 19:50:00 +01:00
|
|
|
button: Button,
|
|
|
|
mods: Modifiers,
|
|
|
|
type: Type,
|