x11/wayland: unbreak key bindings when capslock or numlock are active

Treat these similarly to positional key modifiers, but handle them
centrally to avoid broader issues with eg: interpreting ESC in
the command palette.
This commit is contained in:
Wez Furlong committed 2023-04-10 10:04:19 -07:00
1 parent b0ceebbc2d
commit eaab3d08ae
1 file changed
+3
+3
View File
@@ -307,6 +307,9 @@ impl super::TermWindow {
is_down: bool,
key_event: Option<&KeyEvent>,
) -> bool {
// We don't allow caps lock or num lock to influence key resolution at the GUI layer.
let raw_modifiers = raw_modifiers - (Modifiers::CAPS_LOCK | Modifiers::NUM_LOCK);
if is_down && !leader_active {
// Check to see if this key-press is the leader activating
if let Some(duration) = self.input_map.is_leader(&keycode, raw_modifiers) {