[xmonad] My hack to allow disabling of numlock without messing with my xmonad mod key

Paul Fertser fercerpav at gmail.com
Wed Mar 20 17:56:52 CET 2013


Hi,

On Wed, Mar 20, 2013 at 05:40:34PM +0100, Thomas Løcke wrote:
> All in all this truly is a mess. Disabling a key should be dead-simple. I'm
> guessing it is issues such as this one that the wayland/mir people are trying to
> solve?

Here's my config that I can explain :) modifier_map entries affect
only applications using the core (old protocol), that includes
Xmonad. key entries affect the whole configuration and allow for easy
remapping.

Probably all you need to disable numlock is
modifier_map none   { <NMLK> }; 

// use right alt exclusively for alt, left alt for meta
// map to *_L keys because xvkbd can emulate only left modifiers
partial modifier_keys
xkb_symbols "ralt_as_mod3" {
	key <RALT> {
		[ Alt_L, Alt_L ]
	};
	modifier_map Mod3 { Alt_L };
	key <LALT> {
		[ Meta_L, Meta_L ]
	};
};

// Switch left control and left shift for healthier Emacsing
xkb_symbols "switch_lctl_lfsh" {
	key <LCTL> {
		[ Shift_L, Shift_L ]
	};
	key <LFSH> {
		[ Control_L, Control_L ]
	};
};

// This is needed to workaround a bug in xvkbd to make
// it use Mode_Switch for AltGr (to choose 2nd group)
partial modifier_keys
xkb_symbols "remove_lvl3_from_mod5" {
	modifier_map none { <LVL3> };
};

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com



More information about the xmonad mailing list