Add mouse down out handlers

These will fire whenever the left/right mouse button is pressed down outside a specific region. I'll use these to cancel the context menu in the next commit.
This commit is contained in:
Nathan Sobo 2022-05-27 12:56:44 -06:00
parent 9909fc529b
commit 44c8ee5709
3 changed files with 52 additions and 29 deletions

View file

@ -54,6 +54,8 @@ pub struct MouseRegion {
pub right_mouse_down: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
pub right_click: Option<Rc<dyn Fn(Vector2F, usize, &mut EventContext)>>,
pub drag: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
pub mouse_down_out: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
pub right_mouse_down_out: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
}
#[derive(Copy, Clone, Eq, PartialEq, Hash)]