Japanese keyboard with xorg 1.8+

Xorg has decided to dramatically change the way input devices are handled again. Without too many gory details basically input device configuration has moved back into the xorg.conf file. However, hardware detection is now handled by udev so if you compile your own xorg then you will need to ensure you enable udev support.

After upgrading to xorg 1.8+ you will probably find your Japanese keyboard (that was probably configured using a custom fdi file) is now being treated as a US layout keyboard. Without updating your xorg configuration you will also see the following in your Xorg.log files:

Applying InputClass "evdev keyboard catchall"

This basically means during startup a config was not found for your keyboard so a catchall config is used. Which of course defaults to a US layout.

The New Config

One nice thing about this new change is that you can break out device specific configs and place them in a separate directory. This way your working main config can remain untouched whilst you hack on getting your keyboard working. So here is what you need to do (as root):

1. mkdir /etc/X11/xorg.conf.d

2. vim/etc/X11/xorg.conf.d/90-jp-keyboard.conf

Section "InputClass"

        Identifier "keyboard-all"

        Driver "evdev"

        Option "XkbLayout" "jp"

        Option "XkbOptions" "ctrl:nocaps"

        MatchIsKeyboard "on"

        Option "AutoServerLayout" "on"

EndSection

3. Restart your X session and test.

If you have a working fdi config for your keyboad you can reuse the key-value pairs from it. However, for some reason  Option "XkbVariant" ",jp106" breaks my keayboard completely. Leaving it out worked, YMMV..

tags: Japanese, Linux

Sun 30 Jan 2011, 11:55

1 comments

Thanks for that.Just installed latest-ish xorg and couldnt get the jp106 keyboard to map.

nivek

Back