mach: add mouse motion and mouse button events (#325)
* add mouse motion and mouse button events * add scroll events * switch from button/action to mouse_press and mouse_release events
This commit is contained in:
parent
7b395759b7
commit
a2a6c2a288
4 changed files with 89 additions and 0 deletions
|
|
@ -51,4 +51,19 @@ pub const Event = union(enum) {
|
|||
key_release: struct {
|
||||
key: enums.Key,
|
||||
},
|
||||
mouse_motion: struct {
|
||||
// These are in window coordinates (not framebuffer coords)
|
||||
x: f64,
|
||||
y: f64,
|
||||
},
|
||||
mouse_press: struct {
|
||||
button: enums.MouseButton,
|
||||
},
|
||||
mouse_release: struct {
|
||||
button: enums.MouseButton,
|
||||
},
|
||||
scroll: struct {
|
||||
xoffset: f64,
|
||||
yoffset: f64,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue