mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Ignore numlock and capslock in keybindings
This commit is contained in:
parent
70a87063d1
commit
767bc68acf
@ -101,8 +101,10 @@ defaultDelta :: Rational
|
|||||||
defaultDelta = 3%100
|
defaultDelta = 3%100
|
||||||
|
|
||||||
-- The mask for the numlock key. You may need to change this on some systems.
|
-- The mask for the numlock key. You may need to change this on some systems.
|
||||||
|
-- You can find the numlock modifier by running "xmodmap" and looking for a
|
||||||
|
-- modifier with Num_Lock bound to it.
|
||||||
numlockMask :: KeyMask
|
numlockMask :: KeyMask
|
||||||
numlockMask = lockMask
|
numlockMask = mod2Mask
|
||||||
|
|
||||||
-- What layout to start in, and what the default proportion for the
|
-- What layout to start in, and what the default proportion for the
|
||||||
-- left pane should be in the tiled layout. See LayoutDesc and
|
-- left pane should be in the tiled layout. See LayoutDesc and
|
||||||
|
4
Main.hs
4
Main.hs
@ -94,7 +94,7 @@ grabKeys dpy rootw = do
|
|||||||
ungrabKey dpy '\0' {-AnyKey-} anyModifier rootw
|
ungrabKey dpy '\0' {-AnyKey-} anyModifier rootw
|
||||||
flip mapM_ (M.keys keys) $ \(mask,sym) -> do
|
flip mapM_ (M.keys keys) $ \(mask,sym) -> do
|
||||||
kc <- keysymToKeycode dpy sym
|
kc <- keysymToKeycode dpy sym
|
||||||
mapM_ (grab kc) [mask, mask .|. numlockMask] -- note: no numlock
|
mapM_ (grab kc) [mask, mask .|. numlockMask, mask .|. lockMask, mask .|. numlockMask .|. lockMask]
|
||||||
where
|
where
|
||||||
grab kc m = grabKey dpy kc m rootw True grabModeAsync grabModeAsync
|
grab kc m = grabKey dpy kc m rootw True grabModeAsync grabModeAsync
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ handle (KeyEvent {ev_event_type = t, ev_state = m, ev_keycode = code})
|
|||||||
| t == keyPress
|
| t == keyPress
|
||||||
= withDisplay $ \dpy -> do
|
= withDisplay $ \dpy -> do
|
||||||
s <- io $ keycodeToKeysym dpy code 0
|
s <- io $ keycodeToKeysym dpy code 0
|
||||||
whenJust (M.lookup (complement numlockMask .&. m,s) keys) id
|
whenJust (M.lookup (complement (numlockMask .|. lockMask) .&. m,s) keys) id
|
||||||
|
|
||||||
-- manage a new window
|
-- manage a new window
|
||||||
handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do
|
handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user