Set in /etc/conf.d/keymapsyour keyboard language type e.g. sg for Swiss German (See /usr/share/keymaps).

setxkbmap ch




loadkeys <path to *.map file> to load keyboard translation table to load the kernel keymap for the console.

The command showkey -s (root and preferably not under x since x reads also from /dev/console) shows scan codes of the keyboard pressed and release events.

The system converts those to keycodes shown by the command showkey. Note that the X keyboard driver can convert them and desktop as KDE can convert them again.

How do I set up an International Keyboard Layout? To check multimedia keys press them and then check dmesg. Pressing and releasing the E-Mail button, produces

atkbd.c: Unknown key pressed (translated set 2, code 0x91 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e011 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x91 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e011 <keycode>' to make it known.

Edit the KEYMAP variable in /etc/conf.d/keymaps. To have console working correctly with extended characters in your keymap you might also need to set up variables CONSOLETRANSLATION and CONSOLEFONT in your /etc/conf.d/consolefont (See /usr/share/consolefont for further information on localization of your environment, refer to our localization guide). Then, either reboot, or restart the keymaps and consolefont scripts:

Code Listing 5.1: Restarting keymaps

/etc/init.d/keymaps restart

/etc/init.d/consolefont restart

Mapping keys to applications in kde is easy open the control center, go to regional and accessibility, then keyboard short cuts. Then to command short cut. Select the application you like to map, create the shortcut an press the key.

scan codes can be seen by

showkey -s

and key codes by

showkey -k

Mapping the keycodes seen by the command above to the symbols in /usr/share/X11/XKeysymDB the file .Xmodmap in the home directory has to be edited.

As example the calculator key produces the keycode 140 and this has to be linked to XF86Calculator. So ~/.Xmodmap contains:

keycode 140 = XF86Calculator

Now some code is required to run it: For Kde create the executable ~/.kde/share/config/kdm/Xsession and add:

if [ -f $HOME/.Xmodmap ]; then
    /usr/bin/xmodmap <home path>/.Xmodmap

Linurs Hosttech startpage