diff --git a/crates/eframe/src/web/input.rs b/crates/eframe/src/web/input.rs index eecf7c1f5c54..71586e8f90c4 100644 --- a/crates/eframe/src/web/input.rs +++ b/crates/eframe/src/web/input.rs @@ -151,6 +151,7 @@ pub fn translate_key(key: &str) -> Option { pub fn modifiers_from_kb_event(event: &web_sys::KeyboardEvent) -> egui::Modifiers { egui::Modifiers { + function: event.key() == "Fn", alt: event.alt_key(), ctrl: event.ctrl_key(), shift: event.shift_key(), @@ -167,6 +168,7 @@ pub fn modifiers_from_kb_event(event: &web_sys::KeyboardEvent) -> egui::Modifier pub fn modifiers_from_mouse_event(event: &web_sys::MouseEvent) -> egui::Modifiers { egui::Modifiers { + function: event.get_modifier_state("Fn"), alt: event.alt_key(), ctrl: event.ctrl_key(), shift: event.shift_key(), @@ -183,6 +185,7 @@ pub fn modifiers_from_mouse_event(event: &web_sys::MouseEvent) -> egui::Modifier pub fn modifiers_from_wheel_event(event: &web_sys::WheelEvent) -> egui::Modifiers { egui::Modifiers { + function: event.get_modifier_state("Fn"), alt: event.alt_key(), ctrl: event.ctrl_key(), shift: event.shift_key(),