fix(gui): correct dispatching of mouse dragging events
This commit is contained in:
parent
9b0f40f155
commit
0a9842f34d
3 changed files with 46 additions and 5 deletions
|
|
@ -165,3 +165,11 @@ pub fn mouseButtonId(b: wio.Button) ?u8 {
|
|||
else => null,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn heldMouseButtonId(held: ButtonSet) ?u8 {
|
||||
const mouse_buttons = [_]wio.Button{ .mouse_left, .mouse_right, .mouse_middle, .mouse_back, .mouse_forward };
|
||||
for (mouse_buttons) |btn| {
|
||||
if (held.has(btn)) return mouseButtonId(btn);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue