Sample Header Ad - 728x90

How do I effectively target a specific key-modifier combination in an XKB interpret statement?

2 votes
2 answers
186 views
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?
Asked by smeikx (83 rep)
Jun 1, 2020, 02:38 PM
Last activity: May 21, 2025, 05:22 PM