add focus event
This commit is contained in:
parent
0646280d67
commit
0b140488b4
2 changed files with 6 additions and 0 deletions
|
|
@ -29,4 +29,7 @@ pub enum Event {
|
||||||
/// There will be a single `FilesHoveredLeft` event triggered even if
|
/// There will be a single `FilesHoveredLeft` event triggered even if
|
||||||
/// multiple files were hovered.
|
/// multiple files were hovered.
|
||||||
FilesHoveredLeft,
|
FilesHoveredLeft,
|
||||||
|
|
||||||
|
/// A window was focused or not
|
||||||
|
Focused(bool),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,9 @@ pub fn window_event(
|
||||||
WindowEvent::Touch(touch) => {
|
WindowEvent::Touch(touch) => {
|
||||||
Some(Event::Touch(touch_event(*touch, scale_factor)))
|
Some(Event::Touch(touch_event(*touch, scale_factor)))
|
||||||
}
|
}
|
||||||
|
WindowEvent::Focused(focused) => {
|
||||||
|
Some(Event::Window(window::Event::Focused(*focused)))
|
||||||
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue