特殊:Badtitle/NS100:ComposeKey:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的8个中间版本) | |||
第3行: | 第3行: | ||
== Introduction == | == Introduction == | ||
An alternative to the Gnome [[UbuntuHelp:CharacterMap|CharacterMap]] application is to use Compose Key sequences. This is much faster for special characters which are often used once the required sequences have been learned. | An alternative to the Gnome [[UbuntuHelp:CharacterMap|CharacterMap]] application is to use Compose Key sequences. This is much faster for special characters which are often used once the required sequences have been learned. | ||
The instructions below have been tested with Ubuntu | The instructions below have been tested with Ubuntu (8.10 to 9.04) and Gnome but should also be valid for other versions. | ||
== | == First check your keyboard layout == | ||
First check your keyboard layout | === Ubuntu with Gnome desktop === | ||
From the menu bar select System -> Preferences -> Keyboard -> Layouts -> [Layout Options]. | |||
* Click on the triangle beside ''Compose key position'' to display a list of options; if no box is ticked then the '''Shift'''+'''[[UbuntuHelp:AltGr|AltGr]]''' (Right Alt Key) is the Compose key (also called the ''Multi_Key'' in Xwindow documentation). | * Click on the triangle beside ''Compose key position'' to display a list of options; if no box is ticked then the '''Shift'''+'''[[UbuntuHelp:AltGr|AltGr]]''' (Right Alt Key) is the Compose key (also called the ''Multi_Key'' in Xwindow documentation). | ||
* Click on the triangle beside '' | * Click on the triangle beside ''Key to chose 3rd level''. If no box is ticked then '''[[UbuntuHelp:AltGr|AltGr]]''' should be the 'Third level chooser'. If there is a box labeled "Right Alt, Shift+Right Alt key is Multi_Key" then that is the default assumed here. | ||
If | If any other box is ticked then remember to use that key rather than '''[[UbuntuHelp:AltGr|AltGr]]''' and '''Shift+[[UbuntuHelp:AltGr|AltGr]]''' for the instructions on this page. | ||
There are three methods of entering characters not displayed on keycaps by using combinations of keys. | === Xubuntu with XFCE === | ||
For versions up to 8.04, a compose key can be set by editing (as root) ''/etc/X11/xorg.conf'' | |||
The examples below refer to a UK English keyboard | Find a section ''!InputDevice'' with identifier ''Generic Keyboard'' and add the following line in that section: | ||
== Third level | Option "!XkbOptions" "compose:rwin" | ||
Holding down the '''[[UbuntuHelp:AltGr|AltGr]]''' key and pressing another key will produce a third level character. | This will set the right ''Windows'' key as the compose key. If you would rather use '''[[UbuntuHelp:AltGr|AltGr]]''', replace ''rwin'' by ''ralt''. | ||
For Xubuntu 8.10, edit ''/etc/default/console-setup'' | |||
You will see a line containing the keyword ''XKBOPTIONS''. Edit the line to read: | |||
XKBOPTIONS="compose:rwin" | |||
(again, replace ''rwin'' by ''ralt'' if you prefer '''[[UbuntuHelp:AltGr|AltGr]]''' as the compose key.) | |||
A restart of the Xserver (logout) will be required to effect the change. | |||
=== KDE === | |||
KDE's UserBase has a [http://userbase.kde.org/ComposeKey tutorial on configuring and using the Compose key]. | |||
== Keys == | |||
There are three methods of entering characters not displayed on keycaps by using combinations of keys: the third and fourth level chooser, compose keys, and unicode composition. | |||
The mapping of characters to composite keys will depend on your keyboard and locale. This mapping is defined by files in /usr/share/X11/local. For example /usr/share/X11/locale/en_US.UTF-8/Compose applies to a US English keyboard and UTF-8. With such a variety of combinations the most certain method of confirming keyboard behaviour is to experiment by opening a text editor and typing. | |||
The examples below refer to a UK English keyboard. | |||
== Third and fourth level choosers == | |||
There are four ''levels'' of keyboard entry. Selecting a level involves holding a set of modifier keys down, this changes the function of all the other keys on the keyboard. The levels are, by default: | |||
{|border="1" cellspacing="0" | |||
|''Level''||''Modifier''||''Keys produced'' | |||
|- | |||
|1||None||Lowercase letters, numbers, etc. | |||
|- | |||
|2||Shift||Uppercase letters, symbols printed on keyboard, etc. | |||
|- | |||
|3||[[UbuntuHelp:AltGr|AltGr]]||Extra symbols not printed on the keyboard, some dead keys. | |||
|- | |||
|4||[[UbuntuHelp:AltGr|AltGr]]-Shift||Even more symbols, more dead keys. | |||
|} | |||
Dead keys are keys that appear to do nothing at first; they apply an accent to the next letter you type. | |||
Holding down the '''[[UbuntuHelp:AltGr|AltGr]]''' key and pressing another key will produce a third level character. Holding down the '''[[UbuntuHelp:AltGr|AltGr]]''' and '''Shift''' keys (the order can be important) and pressing another key will produce a fourth level character. In the following list, the first, second. third and fourth levels are shown for a UK keyboard layout. Note that some combinations are ''dead keys''; an additional key-press is required whereupon a diacritic will be added to the final character keyed. | |||
<pre><nowiki> | <pre><nowiki> | ||
`1234567890-= | |||
`1234567890- | ¬!"£$%^&*()_+ | ||
qwertyuiop | |¹²³€½¾{[]}\¸ | ||
asdfghjkl | |¡⅛£¼⅜⅝⅞™±°¿˛ | ||
\zxcvbnm . | </nowiki></pre> | ||
<pre><nowiki> | |||
qwertyuiop[] | |||
QWERTYUIOP{} | |||
@łe¶ŧ←↓→øþ¨~ | |||
ΩŁE®Ŧ¥↑ıØÞ°¯ | |||
</nowiki></pre> | |||
<pre><nowiki> | |||
asdfghjkl;'# | |||
ASDFGHJKL:@~ | |||
æßðđŋħjĸł´^` | |||
ƧЪŊĦJ&Ł˝ˇ˘ | |||
</nowiki></pre> | |||
<pre><nowiki> | |||
\zxcvbnm,./ | |||
|ZCVBNM<>? | |||
|«»¢“”nµ · | |||
¦<>©‘’Nº×÷˙ | |||
</nowiki></pre> | </nowiki></pre> | ||
== Compose key == | == Compose key == | ||
Keying the combination '''Shift'''+'''[[UbuntuHelp:AltGr|AltGr]]''', releasing these keys, then entering two other keys will produce a special character. Many of these will be the reasonable result of overtyping the character keys, eg. | Keying the combination '''Shift'''+'''[[UbuntuHelp:AltGr|AltGr]]''' (''in that order''), releasing these keys, then entering two other keys will produce a special character. Many of these will be the reasonable result of overtyping the character keys, eg. | ||
<pre><nowiki> | <pre><nowiki> | ||
Shift+AltGr a | Shift+AltGr ~ a --> ã (ã in HTML) | ||
Shift+AltGr o | Shift+AltGr / o --> ø (ø in HTML) | ||
Shift+AltGr o c --> © (© in HTML) | |||
Shift+AltGr c o --> ǒ (Ŏ in HTML) | |||
</nowiki></pre> | </nowiki></pre> | ||
Note that the order of the "composed" characters and the state of the shift key can be important. Also, not all versions of Gnome/Ubuntu use the same table of compose key sequences (see below). | |||
If the '''Shift'''+'''[[UbuntuHelp:AltGr|AltGr]]''' key does not work as expected see 'First check your keyboard layout' above. | |||
=== Compose key sequences === | === Compose key sequences === | ||
To discover all the '''Compose key''' combinations possible and, if required set your own preferred combinations: | To discover all the '''Compose key''' combinations possible and, if required set your own preferred combinations: | ||
==== Gnome ==== | ==== Gnome ==== | ||
The compose key sequences used by Gnome are derived from the X compose tables of XFree86 version 4.0 with further modifications to provide a Gnome standard for all locales. They are hard coded into the program in source file < | The compose key sequences used by Gnome are derived from the X compose tables of XFree86 version 4.0 with further modifications to provide a Gnome standard for all locales. They are hard coded into the program in source file <code><nowiki>gtk+-2.10.7/gtk/gtkimcontextsimple.c</nowiki></code> | ||
* '''[[UbuntuHelp:GtkComposeTable|GtkComposeTable]]''' lists the ''Multi_key'' part of | * '''[[UbuntuHelp:GtkComposeTable|GtkComposeTable]]''' lists the ''Multi_key'' part of the Gnome Compose Key table. | ||
* '''[[UbuntuHelp:GtkDeadKeyTable|GtkDeadKeyTable]]''' lists the ''dead key'' combinations. | * '''[[UbuntuHelp:GtkDeadKeyTable|GtkDeadKeyTable]]''' lists the ''dead key'' combinations of the Gnome Compose Key table. | ||
==== XIM ==== | ==== XIM ==== | ||
The Gnome hard coding can be overruled in favour of the original Xwindow Input Method (XIM) by setting the environment variable GTK_IM_MODULE. This can be set in the < | The Gnome hard coding can be overruled in favour of the original Xwindow Input Method (XIM) by setting the environment variable GTK_IM_MODULE. This can be set in the <code><nowiki>/etc/environment</nowiki></code> file, but if the machine has more than one user then it is best set from the home directory on a per user basis by modifying <code><nowiki>~/.gnomerc</nowiki></code> or <code><nowiki>~/.Xsession</nowiki></code> | ||
< | <code><nowiki>export GTK_IM_MODULE="xim"</nowiki></code> | ||
Look at /usr/share/X11/locale/compose.dir to find the appropriate compose table for your locale, eg: | Look at /usr/share/X11/locale/compose.dir to find the appropriate compose table for your locale, eg: | ||
<pre><nowiki> | <pre><nowiki> | ||
第58行: | 第104行: | ||
<Multi_Key> is the Compose ('''Shift+[[UbuntuHelp:AltGr|AltGr]]''') key | <Multi_Key> is the Compose ('''Shift+[[UbuntuHelp:AltGr|AltGr]]''') key | ||
To create your own set of compose keys copy the file /usr/share/X11/locale/en_US.UTF-8/Compose (or if you prefer the equivalent file for your locale) to your home directory as .XCompose | To create your own set of compose keys copy the file /usr/share/X11/locale/en_US.UTF-8/Compose (or if you prefer the equivalent file for your locale) to your home directory as .XCompose | ||
< | <code><nowiki> # cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose </nowiki></code> | ||
and edit this file. | and edit this file. | ||
== Unicode composition == | == Unicode composition == | ||
Another means to enter non-keycap characters is to enter them as Unicode character number. | Another means to enter non-keycap characters is to enter them as Unicode character number. | ||
Press '''Shift'''+'''Ctrl'''+'''U''', release '''U''', enter the hexadecimal (0123456789abcdef) Unicode character code point, then release '''Shift'''+'''Ctrl'''. | |||
'''Shift+Ctrl | An underlined u followed by the number will be displayed as you type. | ||
<pre><nowiki> | <pre><nowiki> | ||
Shift+Ctrl+U 00f4 ô (ô) | Shift+Ctrl+U 00f4 ô (ô) | ||
第70行: | 第116行: | ||
== References == | == References == | ||
[http://www.unicode.org/charts/charindex.html] the authority for ''unicode'' matters | [http://www.unicode.org/charts/charindex.html] the authority for ''unicode'' matters | ||
[http://www.haypocalc.com/wiki/Touche_compose] (en | [http://www.haypocalc.com/wiki/Touche_compose] (en français) | ||
[http://hermit.org/Linux/ComposeKeys.html] list of compose keys | |||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 21:55的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/ComposeKey }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/af | • {{#if: UbuntuHelp:ComposeKey|Afrikaans| [[::ComposeKey/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ar | • {{#if: UbuntuHelp:ComposeKey|العربية| [[::ComposeKey/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/az | • {{#if: UbuntuHelp:ComposeKey|azərbaycanca| [[::ComposeKey/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/bcc | • {{#if: UbuntuHelp:ComposeKey|جهلسری بلوچی| [[::ComposeKey/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/bg | • {{#if: UbuntuHelp:ComposeKey|български| [[::ComposeKey/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/br | • {{#if: UbuntuHelp:ComposeKey|brezhoneg| [[::ComposeKey/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ca | • {{#if: UbuntuHelp:ComposeKey|català| [[::ComposeKey/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/cs | • {{#if: UbuntuHelp:ComposeKey|čeština| [[::ComposeKey/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/de | • {{#if: UbuntuHelp:ComposeKey|Deutsch| [[::ComposeKey/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/el | • {{#if: UbuntuHelp:ComposeKey|Ελληνικά| [[::ComposeKey/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/es | • {{#if: UbuntuHelp:ComposeKey|español| [[::ComposeKey/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/fa | • {{#if: UbuntuHelp:ComposeKey|فارسی| [[::ComposeKey/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/fi | • {{#if: UbuntuHelp:ComposeKey|suomi| [[::ComposeKey/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/fr | • {{#if: UbuntuHelp:ComposeKey|français| [[::ComposeKey/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/gu | • {{#if: UbuntuHelp:ComposeKey|ગુજરાતી| [[::ComposeKey/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/he | • {{#if: UbuntuHelp:ComposeKey|עברית| [[::ComposeKey/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/hu | • {{#if: UbuntuHelp:ComposeKey|magyar| [[::ComposeKey/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/id | • {{#if: UbuntuHelp:ComposeKey|Bahasa Indonesia| [[::ComposeKey/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/it | • {{#if: UbuntuHelp:ComposeKey|italiano| [[::ComposeKey/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ja | • {{#if: UbuntuHelp:ComposeKey|日本語| [[::ComposeKey/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ko | • {{#if: UbuntuHelp:ComposeKey|한국어| [[::ComposeKey/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ksh | • {{#if: UbuntuHelp:ComposeKey|Ripoarisch| [[::ComposeKey/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/mr | • {{#if: UbuntuHelp:ComposeKey|मराठी| [[::ComposeKey/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ms | • {{#if: UbuntuHelp:ComposeKey|Bahasa Melayu| [[::ComposeKey/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/nl | • {{#if: UbuntuHelp:ComposeKey|Nederlands| [[::ComposeKey/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/no | • {{#if: UbuntuHelp:ComposeKey|norsk| [[::ComposeKey/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/oc | • {{#if: UbuntuHelp:ComposeKey|occitan| [[::ComposeKey/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/pl | • {{#if: UbuntuHelp:ComposeKey|polski| [[::ComposeKey/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/pt | • {{#if: UbuntuHelp:ComposeKey|português| [[::ComposeKey/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ro | • {{#if: UbuntuHelp:ComposeKey|română| [[::ComposeKey/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/ru | • {{#if: UbuntuHelp:ComposeKey|русский| [[::ComposeKey/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/si | • {{#if: UbuntuHelp:ComposeKey|සිංහල| [[::ComposeKey/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/sq | • {{#if: UbuntuHelp:ComposeKey|shqip| [[::ComposeKey/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/sr | • {{#if: UbuntuHelp:ComposeKey|српски / srpski| [[::ComposeKey/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/sv | • {{#if: UbuntuHelp:ComposeKey|svenska| [[::ComposeKey/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/th | • {{#if: UbuntuHelp:ComposeKey|ไทย| [[::ComposeKey/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/tr | • {{#if: UbuntuHelp:ComposeKey|Türkçe| [[::ComposeKey/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/vi | • {{#if: UbuntuHelp:ComposeKey|Tiếng Việt| [[::ComposeKey/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/yue | • {{#if: UbuntuHelp:ComposeKey|粵語| [[::ComposeKey/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/zh | • {{#if: UbuntuHelp:ComposeKey|中文| [[::ComposeKey/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/zh-hans | • {{#if: UbuntuHelp:ComposeKey|中文(简体)| [[::ComposeKey/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ComposeKey | UbuntuHelp:ComposeKey | {{#if: | :}}ComposeKey}}/zh-hant | • {{#if: UbuntuHelp:ComposeKey|中文(繁體)| [[::ComposeKey/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:ComposeKey|:ComposeKey|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :ComposeKey/zh | | {{#ifexist: ComposeKey/zh | | {{#ifeq: {{#titleparts:ComposeKey|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:ComposeKey|1|-1|}} | zh | | }}
Introduction
An alternative to the Gnome CharacterMap application is to use Compose Key sequences. This is much faster for special characters which are often used once the required sequences have been learned. The instructions below have been tested with Ubuntu (8.10 to 9.04) and Gnome but should also be valid for other versions.
First check your keyboard layout
Ubuntu with Gnome desktop
From the menu bar select System -> Preferences -> Keyboard -> Layouts -> [Layout Options].
- Click on the triangle beside Compose key position to display a list of options; if no box is ticked then the Shift+AltGr (Right Alt Key) is the Compose key (also called the Multi_Key in Xwindow documentation).
- Click on the triangle beside Key to chose 3rd level. If no box is ticked then AltGr should be the 'Third level chooser'. If there is a box labeled "Right Alt, Shift+Right Alt key is Multi_Key" then that is the default assumed here.
If any other box is ticked then remember to use that key rather than AltGr and Shift+AltGr for the instructions on this page.
Xubuntu with XFCE
For versions up to 8.04, a compose key can be set by editing (as root) /etc/X11/xorg.conf Find a section !InputDevice with identifier Generic Keyboard and add the following line in that section: Option "!XkbOptions" "compose:rwin" This will set the right Windows key as the compose key. If you would rather use AltGr, replace rwin by ralt. For Xubuntu 8.10, edit /etc/default/console-setup You will see a line containing the keyword XKBOPTIONS. Edit the line to read: XKBOPTIONS="compose:rwin" (again, replace rwin by ralt if you prefer AltGr as the compose key.) A restart of the Xserver (logout) will be required to effect the change.
KDE
KDE's UserBase has a tutorial on configuring and using the Compose key.
Keys
There are three methods of entering characters not displayed on keycaps by using combinations of keys: the third and fourth level chooser, compose keys, and unicode composition. The mapping of characters to composite keys will depend on your keyboard and locale. This mapping is defined by files in /usr/share/X11/local. For example /usr/share/X11/locale/en_US.UTF-8/Compose applies to a US English keyboard and UTF-8. With such a variety of combinations the most certain method of confirming keyboard behaviour is to experiment by opening a text editor and typing. The examples below refer to a UK English keyboard.
Third and fourth level choosers
There are four levels of keyboard entry. Selecting a level involves holding a set of modifier keys down, this changes the function of all the other keys on the keyboard. The levels are, by default:
Level | Modifier | Keys produced |
1 | None | Lowercase letters, numbers, etc. |
2 | Shift | Uppercase letters, symbols printed on keyboard, etc. |
3 | AltGr | Extra symbols not printed on the keyboard, some dead keys. |
4 | AltGr-Shift | Even more symbols, more dead keys. |
Dead keys are keys that appear to do nothing at first; they apply an accent to the next letter you type. Holding down the AltGr key and pressing another key will produce a third level character. Holding down the AltGr and Shift keys (the order can be important) and pressing another key will produce a fourth level character. In the following list, the first, second. third and fourth levels are shown for a UK keyboard layout. Note that some combinations are dead keys; an additional key-press is required whereupon a diacritic will be added to the final character keyed.
`1234567890-= ¬!"£$%^&*()_+ |¹²³€½¾{[]}\¸ |¡⅛£¼⅜⅝⅞™±°¿˛
qwertyuiop[] QWERTYUIOP{} @łe¶ŧ←↓→øþ¨~ ΩŁE®Ŧ¥↑ıØÞ°¯
asdfghjkl;'# ASDFGHJKL:@~ æßðđŋħjĸł´^` ƧЪŊĦJ&Ł˝ˇ˘
\zxcvbnm,./ |ZCVBNM<>? |«»¢“”nµ · ¦<>©‘’Nº×÷˙
Compose key
Keying the combination Shift+AltGr (in that order), releasing these keys, then entering two other keys will produce a special character. Many of these will be the reasonable result of overtyping the character keys, eg.
Shift+AltGr ~ a --> ã (ã in HTML) Shift+AltGr / o --> ø (ø in HTML) Shift+AltGr o c --> © (© in HTML) Shift+AltGr c o --> ǒ (Ŏ in HTML)
Note that the order of the "composed" characters and the state of the shift key can be important. Also, not all versions of Gnome/Ubuntu use the same table of compose key sequences (see below). If the Shift+AltGr key does not work as expected see 'First check your keyboard layout' above.
Compose key sequences
To discover all the Compose key combinations possible and, if required set your own preferred combinations:
Gnome
The compose key sequences used by Gnome are derived from the X compose tables of XFree86 version 4.0 with further modifications to provide a Gnome standard for all locales. They are hard coded into the program in source file gtk+-2.10.7/gtk/gtkimcontextsimple.c
- GtkComposeTable lists the Multi_key part of the Gnome Compose Key table.
- GtkDeadKeyTable lists the dead key combinations of the Gnome Compose Key table.
XIM
The Gnome hard coding can be overruled in favour of the original Xwindow Input Method (XIM) by setting the environment variable GTK_IM_MODULE. This can be set in the /etc/environment
file, but if the machine has more than one user then it is best set from the home directory on a per user basis by modifying ~/.gnomerc
or ~/.Xsession
export GTK_IM_MODULE="xim"
Look at /usr/share/X11/locale/compose.dir to find the appropriate compose table for your locale, eg:
# This file contains compose table file names. The first word is the # compose table file name and the second word is the full locale # name. #... en_US.UTF-8/Compose en_GB.UTF-8
then looking at /usr/share/X11/locale/en_US.UTF-8/Compose
# UTF-8 (Unicode) compose sequence #... <Multi_key> <p> <exclam> : "¶" paragraph # PILCROW SIGN <Multi_key> <P> <exclam> : "¶" paragraph # PILCROW SIGN <Multi_key> <plus> <minus> : "±" plusminus # PLUS-MINUS SIGN <Multi_key> <question> <question> : "¿" questiondown # INVERTED QUESTION MARK <Multi_key> <minus> <d> : "đ" dstroke # LATIN SMALL LETTER D WITH STROKE
<Multi_Key> is the Compose (Shift+AltGr) key
To create your own set of compose keys copy the file /usr/share/X11/locale/en_US.UTF-8/Compose (or if you prefer the equivalent file for your locale) to your home directory as .XCompose
# cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose
and edit this file.
Unicode composition
Another means to enter non-keycap characters is to enter them as Unicode character number. Press Shift+Ctrl+U, release U, enter the hexadecimal (0123456789abcdef) Unicode character code point, then release Shift+Ctrl. An underlined u followed by the number will be displayed as you type.
Shift+Ctrl+U 00f4 ô (ô) Shift+Ctrl+U 2203 ∃ (∃)
References
[1] the authority for unicode matters [2] (en français) [3] list of compose keys