From 95281e01ad134751b8d98414ed91ff8d127b83c8 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 18:28:09 +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 3e7c3f76..4d826d98 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -462,8 +462,9 @@ pub fn shortcuts(app: &mut TextureCraftApp, ctx: &egui::Context) { // in egui's input, it runs the Escape and Enter handlers below, the shortcuts and the Path tool's keys for (key, taken) in [(Key::Escape, crate::framework::take_window_cancel(ctx)), (Key::Enter, crate::framework::take_window_submit(ctx))] { if taken { + let escape = craft_ui::runtime::keys::escape_mods(ctx).filter(|_| key == Key::Escape); ctx.input_mut(|i| { - let modifiers = i.modifiers; + let modifiers = escape.map_or(i.modifiers, |held| Modifiers { shift: held.shift, alt: held.alt, ..Modifiers::NONE }); i.events.insert(0, egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }); }); }