1 |
The Gentoo Weekly newsletter (06-12-04) has the answer! |
2 |
|
3 |
================== |
4 |
8. Tips and Tricks |
5 |
================== |
6 |
|
7 |
Revival of the Compose Key a.k.a. Multi_Key |
8 |
------------------------------------------- |
9 |
|
10 |
Many users are on a keyboard layout which does not allow to type other |
11 |
characters than those printed on the keys. There are some workarounds with |
12 |
so-called "deadkeys" so that you can type characters with accents, but |
13 |
that does not enable you to type all characters in your locale. |
14 |
|
15 |
On many Unix-machines you can find a "Compose Key" on the attached |
16 |
keyboard. With that special key you can "compose" the desired character. |
17 |
For instance, typing the sequence <compose> <"> <a> will result in the |
18 |
Umlaut ä. Or take <compose> </> <o> for a danish ø. With X it is no |
19 |
problem to declare any key as the Compose Key, or "Multi_Key" as it is |
20 |
called in the internal routines. Just remember that a keyboard sends only |
21 |
keycodes, and that it is unimportant which keycode represents a given |
22 |
character or special key. |
23 |
|
24 |
To enable the Compose Key you have to alter your /etc/X11/xorg.conf. There |
25 |
are other ways, like using xmodmap, but the global configuration with the |
26 |
xorg.conf ensures that the Compose Key will be available to all users. I |
27 |
recommend the right "Windows Key" (just one of the two on your keyboard |
28 |
enabled should be enough): |
29 |
|
30 |
--------------------------------------------------------------------------- |
31 |
| Code Listing 8.1: | |
32 |
|Enable the Compose Key in the | |
33 |
xorg.conf------------------------------------------------------------------ |
34 |
------- |
35 |
| | |
36 |
|# Your section in xorg.conf about the keyboard looks similar to this: | |
37 |
|Section "InputDevice" | |
38 |
| Identifier "Keyboard0" | |
39 |
| Driver "kbd" | |
40 |
| Option "XkbModel" "pc104" | |
41 |
| Option "XkbLayout" "us" | |
42 |
| Option "XkbOptions" "compose:rwin" | |
43 |
|EndSection | |
44 |
| | |
45 |
--------------------------------------------------------------------------- |
46 |
|
47 |
After you restart X, you should be able to type the characters in the |
48 |
example above. A complete list of available Compose Key characters with |
49 |
their description can be found in the file |
50 |
/usr/X11R6/lib/X11/locale/<your_character_enocding>/Compose. |
51 |
|
52 |
------------------------------------------------------ |
53 |
|
54 |
Extremely cool, as I just checked the file for iso8859-15, and yes, as |
55 |
soon as I set a Compose Key, I will finally be able to type the Euro |
56 |
symbol on my US keyboard using |
57 |
|
58 |
<Multi_key> <e> <equal> : "\244" EuroSign |
59 |
|
60 |
because there is already a setting for the symbol, I just didn't know |
61 |
what it was. |
62 |
|
63 |
Woo hoo! gucharmap can finally get off my menu, and I can type like a |
64 |
normal person. |
65 |
|
66 |
A HUGE shout-out to the Newsletter editors and contributors for this |
67 |
fabulous tip which should help a lot more people than just me. |
68 |
|
69 |
Just a heads-up for those of you who don't get the NL; especially since |
70 |
I know there's at least one other person on this list who doesn't know |
71 |
how to type useful Dutch characters under Linux-- but I couldn't find |
72 |
who it was via a search of my mail, so thought I'd tell everybody ;-) . |
73 |
|
74 |
Holly |
75 |
|
76 |
|
77 |
-- |
78 |
gentoo-user@g.o mailing list |