1

I want to lock a certain modifier (Mod3) when pressing Control + Caps_Lock.

xkb_compatibility "mod3"
{
    // set Control bit on Control_L
    interpret Control_L {
        action = SetMods(modifiers=Control);
    };
    // try locking Mod3 …
    interpret Caps_Lock+Exactly(Control) {
        action = LockMods(modifiers=Mod3);
    };
};

Using xev -event keyboard I never saw the Mod3 bit flipped, even though the Control bit was.

I also tried using just a regular a instead of Caps_Lock, which didn’t change anything.

Further, I tried using AnyOf(Control) instead of Exactly(Control).


What am I missing?
Could anything else in my XKB map interfere with the above attempt?
Or is my assumption about how the interpret statement works just wrong?

1 Answer 1

-4

Try replacing 'action' with 'actions'.

4
  • 1
    I believe action is correct. If you have evidence that this is not so, consider updating your answer with references to official documentation and maybe even a working example.
    – Kusalananda
    Commented Sep 8, 2022 at 8:22
  • When looking at the symbols files, the only reference to 'action' that I see are those using 'actions', e.g. actions[Group1] = [ SetMods(modifiers=NumLock) ] Commented Sep 9, 2022 at 9:09
  • Hmmm... not on my system with X 7.7. I definitely see things like action = SetMods(modifiers=modMapMods); in e.g. X11/xkb/compat/pc.
    – Kusalananda
    Commented Sep 9, 2022 at 9:53
  • 2
    If you have additional information to support your answer, please do not post it in comments; edit your answer to make it clearer and more complete. Commented Sep 11, 2022 at 4:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .