...making Linux just a little more fun! |
By Willy Smith |
I need to be able to type in more than one language. My primary language is English, so I want to use the standard US English keyboard layout; but I also need to be able to type in Spanish, French, and German. The same requirements would also apply to users of other languages such as Italian and Portuguese, as well as several other Western European languages. In these languages, there are special accents and symbols which are not available on the US keyboard. It's very simple to give your keyboard this ability without changing the entire layout.
Since I'm comfortable with the standard English keyboard
layout, and most of my work is in English, I don't want to have to
switch layouts when I switch languages. While I may occasionally have
to use a Spanish or French layout keyboard (for example, in an
Internet café), I find it awkward to have to switch the entire
layout on my office computer to accomodate my different language
needs. Also, I personally find it irritating to have a layout
different from the legend printed on the keytops. The Linux KDE
environment provides total flexibility in this regard. In fact, when
I was researching this article, I found the fexibility to be almost
overwhelming. So this article focuses on how to achieve my own
general requirement as outlined above.
I'm running SuSE 9.0 Linux with the KDE windowing environment. It's very simple to enable the use of accents by accessing the Control Center on the main menu. If you're running a different version of Linux, you'll have to find the equivalent setup menu; perhaps some who are running different versions can add comments to this article about the necessary steps. First, you click on the Regional and Accessibility menu, which has two flags as its icon. Then you click on "Keyboard Layout". There are two tabs for this section. The first tab, labeled "Layout", lets you select from a list of keyboard models. My selection here is the "Generic 104-key PC". The primary layout is "U. S. English w/ deadkeys". This layout changes several of the standard punctuation marks so that they can be used to generate characters with accents. For Spanish and French, I need to be able to put acute, grave, and circumflex accents; occasionally I need other special characters, for example the Umlaut in German. The dead key layout takes care of this need very easily. With this layout, you simply type a single quote ', left single quote `, double quote ", tilde ~, or circumflex ^ to obtain the character you want. The following is a list of the possibilities:
Symbol Next Letter Result ' aeiou c áéíóú ç ` aeiou àèìòù " aeiou äëïöü ~ ao n ãõ ñ ^ aeiou âêîôû
These same sequences work for the capital letters, too. Note that this does take a little getting used to, as if you want only the quote character, you have to press the space bar to make it show up. I found that I quickly got used to this and it became automatic. In fact, it's even easy to change back and forth among computers which are not set up with dead keys, much easier than switching the entire keyboard layout.
For Spanish punctuation, and other special symbols not available on the US keyboard, I needed to set one other option. Go back to the Control Center, click on the Options tab which is next to the Layout tab. Click on the pulldown under the "Compose Key" entry. There you will find several choices for this function. I chose "Right Alt is Compose", although you may want to select the "Windows" or "Menu" key if this is convenient for you. Now I can get the ¿ and ¡ symbols I need for this language. Press the Compose key you have chosen and the correct sequence to get these symbols. For example, to get the upside-down question mark, press the Right Alt key, then the shift key, then the "?" key twice. Again, this may seem complex, but it is quickly learned and becomes automatic.
To get a list of all the symbols which are available to you with the compose key sequences, bring up a console window and type "dumpkeys | grep compose". That's a vertical bar in between dumpkeys and grep; if you can't find the vertical bar character, you can just type "dumpkeys", but you will have to look through the list of all possible keys and find the ones which say "compose". In either case, you will find a list of all possible keypress sequences and the resulting symbols. For example, on my computer I can get the German ß by pressing Right Alt while typing "s" twice, the £ by pressing Right Alt while typing "-L", and the © by pressing Right Alt while typing "oc". The only one I'm missing is the symbol for the euro. Perhaps someone else can figure this out and post it in the comments. Here is a dump of my symbol table:
Sequence |
Result |
---|---|
`A |
À |
`a |
à |
'A |
Á |
'a |
á |
^A |
 |
^a |
â |
~A |
à |
~a |
ã |
"A |
Ä |
"a |
ä |
-a |
ª |
-A |
ª |
OA |
Å |
oa |
å |
0A |
Å |
0a |
å |
AA |
Å |
aa |
å |
°A |
Å |
°a |
å |
AE |
Æ |
ae |
æ |
,C |
Ç |
,c |
ç |
^C |
Ç |
^c |
ç |
`E |
È |
`e |
è |
'E |
É |
'e |
é |
^E |
Ê |
^e |
ê |
"E |
Ë |
"e |
ë |
`I |
Ì |
`i |
ì |
'I |
Í |
'i |
í |
^I |
Î |
^i |
î |
"I |
Ï |
"i |
ï |
-D |
Ð |
-d |
ð |
^D |
Ð |
^d |
ð |
~N |
Ñ |
~n |
ñ |
^N |
Ñ |
^n |
ñ |
`O |
Ò |
`o |
ò |
'O |
Ó |
'o |
ó |
^O |
Ô |
^o |
ô |
~O |
Õ |
~o |
õ |
"O |
Ö |
"o |
ö |
/O |
Ø |
/o |
ø |
-o |
º |
-O |
º |
`U |
Ù |
`u |
ù |
'U |
Ú |
'u |
ú |
^U |
Û |
^u |
û |
"U |
Ü |
"u |
ü |
'Y |
Ý |
'y |
ý |
TH |
Þ |
th |
þ |
ss |
ß |
"y |
ÿ |
sz |
ß |
nn |
ñ |
nh |
ñ |
NY |
Ñ |
NN |
Ñ |
NH |
Ñ |
Ny |
Ñ |
Nn |
Ñ |
Nh |
Ñ |
-L |
£ |
<< |
« |
>> |
» |
?? |
¿ |
^? |
¿ |
!! |
¡ |
^! |
¡ |
^1 |
¹ |
^2 |
² |
^3 |
³ |
+- |
± |
c= |
¢ |
c/ |
¢ |
/c |
¢ |
-c |
¢ |
-C |
¢ |
|c |
¢ |
|C |
¢ |
L= |
£ |
-L |
£ |
-l |
£ |
^* |
× |
^x |
× |
xx |
× |
^. |
· |
.. |
· |
^/ |
÷ |
^: |
÷ |
-: |
÷ |
:- |
÷ |
Y= |
¥ |
=Y |
¥ |
-Y |
¥ |
-l |
¥ |
(c |
© |
"c |
© |
OC |
© |
(C |
© |
C) |
© |
-a |
ª |
-A |
ª |
-o |
º |
-O |
º |
(r |
® |
"r |
® |
OR |
® |
(R |
® |
R) |
® |
mu |
µ |
PP |
¶ |
14 |
¼ |
12 |
½ |
34 |
¾ |
e= |
¤ |
-e |
¤ |
-E |
¤ |
=E |
¤ |
vS |
¦ |
^S |
¦ |
vs |
¨ |
^s |
¨ |
vZ |
´ |
^Z |
´ |
vz |
¸ |
^z |
¸ |
OE |
¼ |
Oe |
¼ |
oe |
½ |
"Y |
¾ |
ij |
ÿ |
IJ |
¾ |
|s |
$ |
|S |
$ |
SS |
§ |
=C |
¤ |
C= |
¤ |
ox |
¤ |
xo |
¤ |
Make sure you press "Apply" on the Control Center menu before you try the new layout, as the changes don't become effective until you've either done this or exited from this program.
None provided.