Simulate mouse up if mouse was released outside window, don't report dragged payload if it was dragged from a different window
This commit is contained in:
parent
fa78b597f4
commit
227cc66594
4 changed files with 77 additions and 24 deletions
|
@ -89,6 +89,20 @@ pub struct MouseMovedEvent {
|
|||
pub shift: bool,
|
||||
}
|
||||
|
||||
impl MouseMovedEvent {
|
||||
pub fn to_button_event(&self, button: MouseButton) -> MouseButtonEvent {
|
||||
MouseButtonEvent {
|
||||
position: self.position,
|
||||
button: self.pressed_button.unwrap_or(button),
|
||||
ctrl: self.ctrl,
|
||||
alt: self.alt,
|
||||
shift: self.shift,
|
||||
cmd: self.cmd,
|
||||
click_count: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Event {
|
||||
KeyDown(KeyDownEvent),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue