From 736e86a9616613d69abb0586e1b87eedf85649f5 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 18:28:00 +0000 Subject: [PATCH] Shift+Escape stays Shift+Escape when Shift is let go at once As before the move to the craft-ui runtime, an Escape shortcut matches the modifiers of its own press, not the ones held when the frame runs. --- crates/ui-egui/src/menus.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 4668e04e..7c5a0ea7 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -462,8 +462,9 @@ pub fn shortcuts(app: &mut MaterialCraftApp, ctx: &egui::Context) { // A plain Escape no widget of MaterialCraft's took is the window's cancel: it runs the Escape shortcuts if crate::framework::take_window_cancel(ctx) { + let held = craft_ui::runtime::keys::escape_mods(ctx).unwrap_or_default(); + let modifiers = egui::Modifiers { shift: held.shift, alt: held.alt, ..Default::default() }; ctx.input_mut(|i| { - let modifiers = i.modifiers; i.events.insert(0, egui::Event::Key { key: egui::Key::Escape, physical_key: Some(egui::Key::Escape), pressed: true, repeat: false, modifiers }); }); }