Previous Next Contents

2. Keyboard setup

2.1 Loading a Danish key-table

You have two tools for configuring your keyboard. Under plain Linux you need loadkeys and under X11 you need xmodmap

To try out loadkeys try typing one of these two commands:

loadkeys /usr/lib/kbd/keytables/dk.map 
loadkeys /usr/lib/kbd/keytables/dk-latin1.map
The difference between the two lines is that dk-latin1.map uses `dead' keys while dk.map doesn't. Dead keys are explained in the section on dead keys. The program loadkeys and the keytables are part of the package kbd-0.90.tar.gz which (with differing version numbers) is available with all Linux distributions.

Usually loadkeys is run at boot-time from one of the scripts in the directory /etc/rc.d/. Details vary widely between distributions but it's a good idea to look for a file called rc.keymap.

(Note for non-Danish users: Support for other languages is enabled similarly. Use es.map for Spanish keyboards etc.)

X11 will to the largest possible extent follow the keymap used by plain Linux, but you can modify keyboard behavior under X11 with xmodmap. Usually the X11 initialization process will run this command atuomatically if you have a file called .Xmodmap in your home directory.

2.2 Getting the AltGr key to work under X

Edit the file /etc/Xconfig (under XFree86 2.0) or /etc/X11/XF86Config or /etc/XF86Config (under XFree86 3.x) and make sure the line

RightAlt    ModeShift
appears in the Keyboard section. Usually you can do this by uncommenting the appropriate line.

2.3 Dead keys and accented characters

Dead keys are those who don't type anything until you hit another key. Tildes and umlauts are like this by default under plain Linux if you use the dk-latin1.map key map. This is the default behaviour under Microsoft Windows as well.

Removing dead key functionality

Under plain Linux log on as root and type

loadkeys dk.map

Invoking dead key functionality

2.4 Making ø (oslash) Ø (Oslash) and $ (the dollar sign) work

The dollar sign

In older versions of loadkeys there's a bug causing the dollar sign to be accessed with Shift-4 instead of AltGr-4 by default. You can fix this by changing the line

keycode   5 = four             dollar           dollar          
in the keymap file to e.g.
keycode   5 = four             asciicircum      dollar
It doesn't matter if you use something else instead of asciicircum if it is a valid symbol name. See section on characters you can display under Linux for a list of valid symbols.

A similar bug appears in some versions of XFree86 and can be fixed by adding

keycode  13 = 4 dollar dollar
to your ~/.Xmodmap or /etc/X11/Xmodmap file.

ø (oslash) and Ø (Oslash)

On some older distributions ø and Ø appear as a cent and a Yen sign. If you have this problem determine what keymap you load at boot-up. You should be able to find out by looking around in the directory /etc/rc.d/ or simply by paying attention to what happens at boot-up. On my computer the keymap is called /usr/lib/kbd/keytables/dk-latin1.map. Find the line for keycode 40 in this file and change it from

keycode  40 = cent              yen
to
keycode  40 = oslash            Ooblique
and load the keytable as described in section on loading keytables.

Note: This bug appears to have been fixed in version 0.88 of the international keytable package.


Previous Next Contents