|
International Keyboard Configuration: Using Multi
key
¿¡ÄäăÁáâçčċÉéÈèÍíÖöÕÔôÜüñ߀£¥
This document is about how I set up a computer running Debian GNU/Linux
with a standard US keyboard to be able to input a wide range of
characters necessary for typing in other languages.
To anyone who uses a keyboard to type in German, French, Spanish, or a
range of other languages which contain diacritical marks it is very
important to be able to type these characters (actually they are
graphemes, not characters).
Configuring the Keyboard in Debian
The easiest way to configure a keyboard to support international
characters is to reconfigure the X server and select the
intl
keyboard layout:
dpkg-reconfigure xserver-xfree86
The other way (perhaps this is actually more simple) is to edit
/etc/X11/XF86Config-4
and enter
intl
for the
XkbLayout
option:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option
"CoreKeyboard"
Option
"XkbRules" "xfree86"
Option
"XkbModel" "pc102"
Option
"XkbLayout" "intl"
EndSection
To configure the console (non-X) keyboard install the console-data
package if it is not already installed or, if it is, reconfigure it:
apt-get install console-data
-or-
dpkg-reconfigure console-data
For U.S. keyboards I recommend selecting:
qwerty - US American - Standard - US International
(ISO 8859-15)
Producing Graphemes using Multi-key vs. Deadkey
The terminology related to keymaps is a little bit strange but there are
a couple of terms worth learning. One is the term
symbol.
You would probably guess that a symbol is a thing one sees typed on a
screen but this is wrong. A symbol
is a sequence of one or more key presses which produce a
grapheme
which is the thing one sees on one's monitor. Because not all
symbols produce graphemes they are called
dead
symbols. For example if you ever chose the U.S. International
keyboard layout on Windows machine you would notice that pressing the <quoteright>
key (the apostrophe key) by itself produces no graphemes. Instead,
if you press one of a number of keys after having pressed quoteright the
behaviour of that key is altered. So pressing <quoteright><e>
produces not the grapheme e but rather e-acute, é. What happend
was that under the U.S. International layout in Windows the symbol
associated with the <quoteright> gets changed from apostrophe to dead
acute. Note that the symbol to produce apostrophe has not
disappeared. It is changed to <quoteright><spacebar>.
Many people who need to type international characters do not like the
behavior of this U.S. International layout because it is annoying to
always have to type <quoteright><spacebar> when one wants to type an
apostrophe, or <shift>-<quoteright><spacebar> to type a double quote.
Enter Multi-key
Fortunately there is a much better way to produce international
characters which not only avoids the drawbacks of of the deadkey
approach but also extends the possible number of characters much
further. This approach creates a new special key called Multi-key
which is usually assigned to either the right-Alt key or to the
right-Windows key if there is one.
Just as the spacebar functions as a special key which combines with
other keys so does Multi-key. But Multi-key is even more than
this. Multi-key acts more like a special toggle switch. For
example to type e-acute using Multi-key one types <rightalt><quoteright><e>.
Note that unlike with the shift key one does not have to simultaneously
press Multi-key and the consecutive key at the same time.
Following is a table of keys with associated symbol names and example
graphemes which they produce.
|
Key Name |
key
|
with shift
|
with multi
|
with multi + shift
|
TLDE
|
quoteleft |
asciitilde |
dead_grave, |
dead_tilde |
|
` |
~ |
àÀèÈùÙìÌòÒ |
ãÃñÑ |
AE01
|
1
|
exclam |
|
paragraph, section |
<multi><shift> <!><!> - <p> - <s> |
|
1 |
! |
|
¡
¶ § |
AE05
|
5 |
percent |
|
|
|
5 |
% |
|
|
AE06
|
6 |
asciicircum |
|
dead_circumflex
|
|
6 |
^ |
|
âÂêÊîÎôÔûÛ |
AE09
|
9 |
parenleft |
|
dead_breve
|
|
9 |
( |
|
ăĂ®ğĞ
|
AE10
|
0
|
parenright
|
copyright, section
sign, EuroSign (some apps) |
|
<multi><ae10> <c> - <s> - <x>
|
|
0 |
) |
©
§ €
|
|
AE12
|
equal
|
plus
|
EuroSign (some apps),
yen, sterling |
|
<multi><ae12> <e> - <l> - <y> |
|
= |
+ |
€ ¥
£ |
# ¯][ |
AC02
|
s
|
S
|
Eszett - Scharfes-S |
|
|
<multi><s><s> |
|
s |
S |
ß |
|
AC10
|
semicolon |
colon |
dead_ogonek ??? |
|
|
; |
: |
|
|
AC11
|
quoteright |
quotedbl |
dead_acute |
dead_diaeresis
(umlaut, dieresis) |
|
' |
" |
áÁéÉŕŔýÝúÚíÍóÓśŚĺĹźŹćĆńŃ |
äÄëËïÏöÖüÜÿŸ |
AB08
|
comma |
less |
dead_cedilla |
dead_caron |
|
, |
< |
ąĄçÇęĘŗįĮŗŖųŲşŞģĢķĶļĻņŅ |
čČěĚřŘťŤšŠďĎľĽžŽňŇ |
AB09
|
period |
greater |
dead_abovedot |
dead_circumflex |
|
. |
> |
ċĊėĖṫṪıİṗṖṡṠḋḊḟḞġĠżŻḃḂṁṀ |
âÂêÊûÛîÎôÔ |
AB10
|
slash |
question |
cent, dead_hook |
dead_hook |
/
|
?
|
¢ŧŦµøØ
|
<multi><?><?> |
|
¿ |
Below
are some possible keys that Mutli_key can be assigned to, along with a
few other symbols these keys may have (in no particular order).
|
|
RALT |
Alt_R |
Meta_R |
Mode_switch |
Multi_key |
|
LWIN |
Super_L |
|
|
|
|
RWIN |
Super_R |
Multi_key |
|
|
If you are ever curious about the inner workings of keyboard layouts you
can look at some of the configuration files which are used to associate
various physical keyboard types with different keyboard layouts.
See
/etc/X11/xkb/rules/xfree86
for a full list of physical keyboard types. Here is an example
section from this file:
model layout
symbols
pc102
us
us(pc102)
pc102
en_US en_US(pc102)
pc102
intl us(pc102compose)
pc102
euro us(pc102euro)
pc104
us
us(pc104)
pc104
en_US en_US(pc104)
pc104 intl
us(pc104compose)
pc105
us
us(pc105)
In the symbols column above the values us and en_US refer to
/etc/X11/xkb/symbols/us
and
/etc/X11/xkb/symbols/en_US. In
those files we find the entries corresponding to pc102, pc102compose,
pc104, pc104compose, etc.
/etc/X11/xkb/rules/xfree86 contains names of keyboard
models and mappings of layouts to symbol sets. Symbol sets are
defined in:
/etc/X11/xkb/symbols
First identify a physical keyboard type. Find it in the rules
file and see what layouts are available for it. Normally the
symbol sets with the name "compose" in them link to symbol sets in
/etc/X11/xkb/symbols which assign Multi_key to either RALT or RWIN (and
of course you could change this if you want. For example some
people prefer assigning Multi_key to LWIN).
If you want to see all the possible symbols that can be mapped to a key
in all the different keyboard layouts (kind of cool to see), try this:
grep -ri -A1 <keyname> /etc/X11/xkb/symbols/ | less
where <keyname> is something like AC02
or you can use a symbol name like "eurosign" too see the various keys
that the euro symbol might be assigned to:
grep -ri -B1 eurosign /etc/X11/xkb/symbols/ | less
In /etc/X11/xkb/symbols/us
and other files Multi_key gets
assigned according the the keyboard type and layout selected from
/etc/X11/xkb/rules/xfree86. To decide which layout is best to use
have a look at /etc/X11/xkb/symbols/us
and see what key is being mapped to Multi_key:
xkb_symbols "pc102compose" {
include "us(pc101compose)"
key <LSGT>
{
[ less,
greater
] };
};
xkb_symbols "pc101compose" {
include "us(generic101)"
key <LALT>
{
[ Alt_L,
Meta_L
] };
key <RALT>
{
[
Multi_key
] };
Here we see that pc102compose assigns only one symbol itself and then
includes everything from the pc101compose assignment. In the
pc101compose assignment we see that Multi_key gets
assigned to RALT. If you choose pc104compose (by selecting
pc104/intl for model/layout) you can see Multi_key gets assigned to RWIN
(just look at the entry in /etc/X11/xkb/symbols/us).
By knowing the important symbols and where and how they get assigned
one can see how assignments can be easily made whichever way one
wants.
This is not the end however. The applications one uses must
be able to support these graphemes. This Perl statement will
print out a range of special graphemes which is useful to see of the
font in your terminal can handle them:
perl -e 'for$i(160..255){printf"%c%c",$i,($i%16==15)?10:32}'
Unfortunately many of the default fonts used by applications still
do not support these graphemes. For example, in order to get
xterm and rxvt to display (most of) these graphemes one can assign
the fonts in
~/.Xdefaults
like so:
XTerm*font: -misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-15
XTerm*VT100*font2: -misc-fixed-medium-r-normal-*-*-70-*-*-c-*-iso8859-15
XTerm*VT100*font3:
-misc-fixed-medium-r-normal-*-*-100-*-*-c-*-iso8859-15
XTerm*VT100*font4:
-misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-15
XTerm*VT100*font5:
-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-15
XTerm*VT100*font6:
-misc-fixed-medium-r-normal-*-*-200-*-*-c-*-iso8859-15
Regarding
Locales
Locales are another component in the language/grapheme set
puzzle. One way to reconfigure and/or set the default locale for
your system is to run:
dpkg-reconfigure locales
(Make sure you have locales installed. Installing localeconf is a
good idea also.)
I recommend using ISO-8859-1 or
ISO-8859-15.
|
|