more event wip
This commit is contained in:
@@ -51,6 +51,15 @@ impl MouseEventHandler {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_up(
|
||||
mut self,
|
||||
button: MouseButton,
|
||||
handler: impl Fn(MouseButtonEvent, &mut EventContext) + 'static,
|
||||
) -> Self {
|
||||
self.handlers = self.handlers.on_up(button, handler);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_click(
|
||||
mut self,
|
||||
button: MouseButton,
|
||||
@@ -69,6 +78,15 @@ impl MouseEventHandler {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_up_out(
|
||||
mut self,
|
||||
button: MouseButton,
|
||||
handler: impl Fn(MouseButtonEvent, &mut EventContext) + 'static,
|
||||
) -> Self {
|
||||
self.handlers = self.handlers.on_up(button, handler);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_drag(
|
||||
mut self,
|
||||
button: MouseButton,
|
||||
@@ -78,6 +96,15 @@ impl MouseEventHandler {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_drag_over(
|
||||
mut self,
|
||||
button: MouseButton,
|
||||
handler: impl Fn(bool, MouseMovedEvent, &mut EventContext) + 'static,
|
||||
) -> Self {
|
||||
self.handlers = self.handlers.on_drag_over(button, handler);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_hover(
|
||||
mut self,
|
||||
handler: impl Fn(bool, MouseMovedEvent, &mut EventContext) + 'static,
|
||||
|
||||
Reference in New Issue
Block a user