Skip to content

Commit

Permalink
Fix Emits of Additional ANSI Characters
Browse files Browse the repository at this point in the history
This commit ensures that ANSI chars won't be emitted when pressing
non-standard modifier keys.

Fixes wez#4975
  • Loading branch information
schrieveslaach committed Feb 10, 2024
1 parent a7d9cfd commit de9ef54
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion window/src/os/x11/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,17 @@ 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 none-standard modifier keys of Neo2 layout are not mapped
// te a fallback because that would result in extra emitions of the
// original ANSI characters
&& !matches!(
xsym,
xkbcommon::xkb::Keysym::ISO_Level3_Shift
| xkbcommon::xkb::Keysym::ISO_Level5_Shift
)
{
// Not sure if this is a good idea, see
// <https://github.com/wez/wezterm/issues/4910> for context.
match fallback_feed {
Expand Down

0 comments on commit de9ef54

Please sign in to comment.