diff --git a/jay-config/src/input.rs b/jay-config/src/input.rs index 94259bd0..ae185f1e 100644 --- a/jay-config/src/input.rs +++ b/jay-config/src/input.rs @@ -150,6 +150,9 @@ impl Seat { /// The closure is invoked when the user presses the last key of the modified keysym. /// Note that the keysym is calculated without modifiers applied. To perform an action /// when `SHIFT+k` is pressed, use `SHIFT | SYM_k` not `SHIFT | SYM_K`. + /// + /// CapsLock and NumLock are ignored during modifier evaluation. Therefore, bindings + /// containing these modifiers will never be invoked. pub fn bind, F: Fn() + 'static>(self, mod_sym: T, f: F) { get!().bind(self, mod_sym, f) } diff --git a/src/ifs/wl_seat/event_handling.rs b/src/ifs/wl_seat/event_handling.rs index 7192f971..de22e181 100644 --- a/src/ifs/wl_seat/event_handling.rs +++ b/src/ifs/wl_seat/event_handling.rs @@ -31,7 +31,11 @@ use { wire::WlDataOfferId, xkbcommon::{ModifierState, XKB_KEY_DOWN, XKB_KEY_UP}, }, - jay_config::keyboard::{mods::Modifiers, syms::KeySym, ModifiedKeySym}, + jay_config::keyboard::{ + mods::{Modifiers, CAPS, NUM}, + syms::KeySym, + ModifiedKeySym, + }, smallvec::SmallVec, std::rc::Rc, }; @@ -339,7 +343,8 @@ impl WlSeatGlobal { let old_mods = kb_state.mods(); let keysyms = kb_state.unmodified_keysyms(key); for &sym in keysyms { - if let Some(mods) = self.shortcuts.get(&(old_mods.mods_effective, sym)) { + let mods = old_mods.mods_effective & !(CAPS.0 | NUM.0); + if let Some(mods) = self.shortcuts.get(&(mods, sym)) { shortcuts.push(ModifiedKeySym { mods, sym: KeySym(sym),