The compose key is used to enter characters on the keyboard that are usually not available on the key caps. Such letters could be an "umlaut", a "macron" or accents on letters:
Further information may be found in the Links and Further Information section below.
The modifications will work with (almost) all applications, including the desktop environment, browsers, LibreOffice, as well as many console/text only applications.
如下的教程会设定一个<compose>键，，同时映射到<right logo>键（多数键盘上这个logo 是Windows logo）。
|This instruction are old and only works in Debian based system. If you know a better way, feel free to edit this wiki page.|
To do this properly I'm trying to go the "holistic way" starting with the console:
$ sudo dpkg-reconfigure console-setup
I'd much rather like to use the left logo key, but that's not available in the console setting. But in the graphical window environment (KDE Plasma) that is possible.
I guess that selection should give me the wanted characters.
|This instruction are probably obsolete. If GTK applications don't work out-of-the-box, please go to the Troubleshooting section.|
GTK (such as also Firefox) and Gnome applications use (on an Ubuntu system) usually SCIM as the input method, not XIM (X Input Method) that relies on the configurations from (X)Compose. Therefore, you will often find that the "a" and "o" macron characters can yield the female/male ordinals "ª" and "º". To still make it work, GTK applications need to be "told" to use XIM instead.
$ GTK_IM_MODULE=xim firefox
对于单个 shell 会话永久的设置可以这样：
$ export GTK_IM_MODULE=xim
$ sudo cp /etc/X11/xinit/xinput.d/default /etc/X11/xinit/xinput.d/xim
... GTK_IM_MODULE=xim QT_IM_MODULE=xim ...
$ sudo ln -sf /etc/X11/xinit/xinput.d/xim /etc/X11/xinit/xinput.d/all_ALL
If you are using a Debian-derived distribution use following instead
$ sudo update-alternatives --verbose --install /etc/X11/xinit/xinput.d/all_ALL xinput-all_ALL /etc/X11/xinit/xinput.d/xim 20
既然你当前用 XIM，你可以进一步调整 XCompose 输入映射便于输入更多字符，或是调整键位安排方便输入等等。
# ~/.XCompose # This file defines custom Compose sequences for Unicode characters
# Import default rules from the system Compose file: include "/usr/share/X11/locale/en_US.UTF-8/Compose"
# To put some stuff onto compose key strokes: <Multi_key> <minus> <greater> : "→" U2192 # Compose - > <Multi_key> <colon> <parenright> : "☺" U263A # Compose : ) <Multi_key> <h> <n> <k> : "hugs and kisses" # Compose h n k <Multi_key> <less> < p> : "< p></p>" # Compose < p
The compose key will be now whatever you have configured it to be, e. g. right logo.
compose + shift + hyphen then <vowel >or
compose + underscore then <vowel >→
compose + shift + <single quote> then <vowel >or
compose + <double quotes> then <vowel >→
compose then s and s (twice the "s")→
Delete in .xinputrc the line with the following content:
run_im ibus. After reboot your computer or logout from your user X session.