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

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" and while that does indeed disable the key while retaining the ON setting from my SLiM login manager, it also wreaks havoc on my xmonad mod key, which no longer works. I've got my modMask set to mod4Mask. I've tried using the default modMask, but the problem is still there. I've also tried using numlockx (instead of SLiM) to set numlock = ON, but that changes nothing: Clearing the mod2 key still mess up my xmonad. I've tried remapping the numlock keycode to nothing or to some other key, with no success. I'm at my wits end. Thomas Løcke

On Mon, Feb 4, 2013 at 9:45 AM, Thomas Løcke
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 setNumlockMask grabKeys Regards, Adam

On Mon, Feb 4, 2013 at 10:53 AM, adam vogt
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 setNumlockMask grabKeys
fwiw I don't see why this (or ensuing operations, notably cleanMask) would fail. Might be worth trying DebugKeyEvents to see what's going on? http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DebugKeyEvents.htm... -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Mon, Feb 4, 2013 at 6:15 PM, Brandon Allbery
fwiw I don't see why this (or ensuing operations, notably cleanMask) would fail. Might be worth trying DebugKeyEvents to see what's going on?
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DebugKeyEvents.htm...
I tried adding this to my xmonad.hs and recompile/restart, but I'm not getting any output to .xsession-errors. I imported XMonad.Hooks.DebugKeyEvents and appended <+> debugKeyEvents to my handleEventHook. Am I missing something?

On Mon, Feb 4, 2013 at 4:53 PM, adam vogt
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)
This is my current handleEventHook: , handleEventHook = fullscreenEventHook How do I add the code you proposed? Do I just append it with a <+>?

On Tue, Feb 5, 2013 at 4:18 AM, Thomas Løcke
On Mon, Feb 4, 2013 at 4:53 PM, adam vogt
wrote: 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)
This is my current handleEventHook:
, handleEventHook = fullscreenEventHook
How do I add the code you proposed? Do I just append it with a <+>?
Exactly.
participants (3)
-
adam vogt
-
Brandon Allbery
-
Thomas Løcke