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.
This commit is contained in:
aiongg committed 2026-11-25 18:28:00 +00:00
1 parent 8b2dafdffe
commit 736e86a961
1 file changed
+2 -1
+2 -1
View File
@@ -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 });
});
}