From 94fbf53d208977e0896b3976310e913aeea367e3 Mon Sep 17 00:00:00 2001 From: Marc Schreiber Date: Fri, 20 Nov 2026 01:44:34 +0100 Subject: [PATCH] x11: Fix emits of additional ANSI chars from non-standard mods (#4991) This ensures that ANSI chars won't be emitted when pressing non-standard modifier keys. Fixes #4975 --- window/src/os/x11/keyboard.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/window/src/os/x11/keyboard.rs b/window/src/os/x11/keyboard.rs index 1828b2645..78aa6dc68 100644 --- a/window/src/os/x11/keyboard.rs +++ b/window/src/os/x11/keyboard.rs @@ -396,7 +396,13 @@ impl KeyboardWithFallback { } _ => sym, } - } else if kc.is_none() && key_code_from_sym.is_none() { + } else if kc.is_none() + && key_code_from_sym.is_none() + // Make sure that non-standard modifier keys are not mapped + // to a fallback because that would result in extra emits of + // the original ANSI characters + && !xsym.is_modifier_key() + { // Not sure if this is a good idea, see // for context. match fallback_feed {