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.
AltGr
key to work under XEdit 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.
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.
Under plain Linux log on as root and type
loadkeys dk.map
Under plain Linux log on as root and type
loadkeys dk-latin1.map
Insert the following lines in a file ~/.Xmodmap
or /etc/X11/Xmodmap
keycode 21 = acute Dgrave_accent bar
keycode 35 = Ddiaeresis Dcircumflex_accent Dtilde
You can now make the dead keys work by typing (e.g.)
xmodmap ~/.Xmodmap
. Mostly this command will be
issued automatically when you start up X. Do not follow this
procedure if you use X11R6.
(Note for non-Danish readers: You can find the
relevant key-codes for your own keyboard by using xev
- it displays
a little window and prints out all events it sees including key-codes
for use with xmodmap
.)
First you must make sure you are running XFree86 v3.1.2 or
higher. Download and install everything related to this release if
you have a lower version number.
Dead keys won't work in X11R6 applications unless these were compiled
with support for this input method. A useful example of such an
application is emacs
version 19.30 (or higher) or the version
of xterm
available at
ftp://ftp.x.org/contrib/applications/
as
xterm-R6-sb_right-ansi-3d.tar.gz
.
Next you'll have to map some key to Compose
or (equivalently)
Multi_Key
. The Scroll Lock
key is most likely already
mapped thus (you can verify this with xev
,) and you can easily
map the right Control
key by uncommenting the appropriate line in
the XFree86 configuration file (often /etc/XF86Config
). If
you wish to use some other key you should put something like
keycode 96 = Multi_key
in your ~/.Xmodmap
file.
Finally make sure your shell and/or application is set up for
iso-latin-1 compatibility as described in
section on specific applications and you should be all set. You
can e.g. get ã by
typing Compose - a - ~
. And if dead keys work under
plain Linux they ought also to work under X11 now. The available keystroke
combinations are listed in
/etc/X11/locale/iso8859-1/Compose
.
Many X applications do not support this general input method. Eventually this situation might improve, but until then you can either hack your applications or submit polite bug reports to their authors. The latter method is often the most efficient.
ø
(oslash) Ø
(Oslash) and $
(the dollar sign) workIn 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.