mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-02-24 00:37:43 +11:00
Implement focus event
This commit is contained in:
parent
a5166baba2
commit
96786bbb87
1 changed files with 10 additions and 2 deletions
|
@ -106,9 +106,17 @@ impl<T> EventLoop<T> {
|
||||||
runner.set_listener(Box::new(move |evt, ctrl| event_handler(evt, &relw, ctrl)));
|
runner.set_listener(Box::new(move |evt, ctrl| event_handler(evt, &relw, ctrl)));
|
||||||
|
|
||||||
let document = &document();
|
let document = &document();
|
||||||
add_event(&runner, document, |_, _: BlurEvent| {
|
add_event(&runner, document, |elrs, _: BlurEvent| {
|
||||||
|
elrs.send_event(Event::WindowEvent {
|
||||||
|
window_id: RootWI(WindowId),
|
||||||
|
event: WindowEvent::Focused(false)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
add_event(&runner, document, |_, _: FocusEvent| {
|
add_event(&runner, document, |elrs, _: FocusEvent| {
|
||||||
|
elrs.send_event(Event::WindowEvent {
|
||||||
|
window_id: RootWI(WindowId),
|
||||||
|
event: WindowEvent::Focused(true)
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
add_event(&runner, document, |elrs, event: KeyDownEvent| {
|
add_event(&runner, document, |elrs, event: KeyDownEvent| {
|
||||||
|
|
Loading…
Add table
Reference in a new issue