Sunday, January 18, 2015

International keyboard layout on Gentoo

This is my keyboard setup for an international layout because I used quite a lot of umlauts and eszett.

Entry from /usr/share/X11/xorg.conf.d/10-evdev.conf:

Section "InputClass"
   Identifier "evdev keyboard catchall"
   MatchIsKeyboard "on"
   MatchDevicePath "/dev/input/event*"
   Driver "evdev"
   Option        "XkbModel" "pc105"
   Option        "XkbLayout" "us_intl"
   Option        "XkbOptions" "compose:menu"
EndSection


The compose key is used to type "ß" because for a long while I couldn't for the life of me figure out how to get "Alt-Gr" to work on Gentoo. And then I found out that all I had to do was to map "Mode_switch" to the right Alt keycode.

Using xev, I found that the keycode for the right Alt is 108. So this is my entry in ~/.Xmodmap

keycode 108 = Mode_switch

And just for fun, this is how to map the "s" key so that you can type the capital eszett ẞ (not ß)

keycode 39 = s S ssharp U1E9E

For those who are curious as to how the keycode format works: here's the explanation I've taken from this website:


keycode  = <1> <2> <3> <4> <5> <6> <7> <8>
 
 
     <1>                           
     <2>                     
     <3>             <"Mode_switch"-key>
     <4>       
     <5>                <"Num_Lock"-key> 
     <6>               -
     <7>  <"Num_Lock"-"Mode_switch"-key>
     <8>