fix(menus): Alt held through a shortcut no longer puts the keyboard on the menu bar, so Enter reaches the dialog (#7481)

This commit is contained in:
Korg1ch
2026-10-19 00:04:38 +03:00
parent 9185b64b94
commit 8c6166849a
+6 -1
View File
@@ -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;