From 8c6166849ae13734be40bf1e1fc92bcddc021d44 Mon Sep 17 00:00:00 2001 From: Korg1ch <57859048+Korg1ch@users.noreply.github.com> Date: Mon, 19 Oct 2026 00:04:38 +0300 Subject: [PATCH] fix(menus): Alt held through a shortcut no longer puts the keyboard on the menu bar, so Enter reaches the dialog (#7481) --- crates/ui-egui/src/menu_keys.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menu_keys.rs b/crates/ui-egui/src/menu_keys.rs index 83fe21a550..d033d7aec6 100644 --- a/crates/ui-egui/src/menu_keys.rs +++ b/crates/ui-egui/src/menu_keys.rs @@ -208,7 +208,12 @@ impl Keys { } let events = ctx.input(|i| i.events.clone()); let mut tap = false; - for e in &events { + // The tap is judged on every event of the frame, also those another handler consumed + // before the bar's turn: the shortcuts run first, so Ctrl+Alt+I (Image Size) left no + // trace in `events`, and releasing Alt counted as a tap that put the keyboard on the bar; + // Enter then opened File instead of confirming the dialog (#7481). + let raw = ctx.input(|i| i.raw.events.clone()); + for e in &raw { match e { Event::Key { key: Key::AltLeft | Key::AltRight, pressed: true, .. } => { self.alt_down = true;