TUTORIAL: Only user letter keys for the bindings

On IRC an issue came up where a user couldn't press M-] since they were
using a German keyboard layout and ] is put behind some AltGr
combination.  The correct way to specify that would be something along
the lines of M-M5-9, but we don't really want to go into that in the
tutorial.  Thus, only use the obvious modifiers, as well as letters,
which should work on every layout.
This commit is contained in:
Tony Zorman 2022-05-17 18:28:53 +02:00
parent f61fdbaf0c
commit 54d921c5a6

View File

@ -187,8 +187,8 @@ example, but that will change soon enough so it's worth introducing it
here as well. here as well.
What if we wanted to add other keybindings? Say you also want to bind What if we wanted to add other keybindings? Say you also want to bind
`M-S-z` to lock your screen with the screensaver, `M-S-=` to take a `M-S-z` to lock your screen with the screensaver, `M-C-s` to take a
snapshot of one window, and `M-]` to spawn Firefox. This can be snapshot of one window, and `M-f` to spawn Firefox. This can be
achieved with the `additionalKeysP` function from the achieved with the `additionalKeysP` function from the
[XMonad.Util.EZConfig] module—luckily we already have it imported! Our [XMonad.Util.EZConfig] module—luckily we already have it imported! Our
config file, starting with `main`, now looks like: config file, starting with `main`, now looks like:
@ -200,8 +200,8 @@ main = xmonad $ def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
``` ```
@ -313,8 +313,8 @@ main = xmonad $ def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
``` ```
@ -396,8 +396,8 @@ main = xmonad $ ewmhFullscreen $ ewmh $ def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
``` ```
@ -420,8 +420,8 @@ myConfig = def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
``` ```
@ -989,8 +989,8 @@ myConfig = def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
``` ```
@ -1032,8 +1032,8 @@ myConfig = def
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock") [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-=", unGrab *> spawn "scrot -s" ) , ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-]" , spawn "firefox" ) , ("M-f" , spawn "firefox" )
] ]
myManageHook :: ManageHook myManageHook :: ManageHook