1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

eframe web: ensure modifiers keys won't stick in a down state on alt-tab (#2857)

* eframe web: ensure modifiers keys won't stick in a down state on alt-tab

* Update changelog

* Properly set the has_focus input flag on web
This commit is contained in:
Emil Ernerfeldt
2023-03-31 10:11:41 +02:00
committed by GitHub
parent 5cdbce04a8
commit eb0812a953
3 changed files with 55 additions and 19 deletions

View File

@@ -30,6 +30,13 @@ impl WebInput {
..self.raw.take()
}
}
pub fn on_web_page_focus_change(&mut self, has_focus: bool) {
self.raw.modifiers = egui::Modifiers::default();
self.raw.has_focus = has_focus;
self.latest_touch_pos = None;
self.latest_touch_pos_id = None;
}
}
// ----------------------------------------------------------------------------
@@ -548,6 +555,7 @@ fn start_runner(app_runner: AppRunner, follow_system_theme: bool) -> Result<AppR
super::events::install_canvas_events(&mut runner_container)?;
super::events::install_document_events(&mut runner_container)?;
super::events::install_window_events(&mut runner_container)?;
text_agent::install_text_agent(&mut runner_container)?;
if follow_system_theme {