[xmonad] xmodmap -e "clear mod2" is killing my xmonad mod key

adam vogt vogt.adam at gmail.com
Mon Feb 4 16:53:33 CET 2013

On Mon, Feb 4, 2013 at 9:45 AM, Thomas Løcke <thomas.granvej6 at gmail.com> wrote:
> Hey all,
> The rollout to my employees are going well. The BETA group are very
> satisfied with the setup, and all minor niggles have been sorted out so far.
> Except for one thing: Due to a legacy Windows XP application that isn't
> playing very nice with VirtualBox, we need to disable the numlock key
> completely. What we need is simple:
> 1. Activate numlock upon login.
> 2. Disable the numlock key so numlock stays ON under all circumstances
> I was convinced that this was easily solved by adding some xmodmap magic to
> .xinitrc:
> xmodmap -e "clear mod2"

Hi Thomas,

The following added to a config lets xmonad work after you `xmodmap -e
"clear mod2"':

 handleEventHook = ( \e -> case e of
                                MappingNotifyEvent {} -> return (All False)
                                _ -> mempty)

The False in there makes xmonad skip this code in XMonad/Main.hsc. It
might be a bug that your situation isn't handled properly.

-- set keyboard mapping
handle e@(MappingNotifyEvent {}) = do
    io $ refreshKeyboardMapping e
    when (ev_request e `elem` [mappingKeyboard, mappingModifier]) $ do


More information about the xmonad mailing list