Contents |
compose 键是键盘用来输入不在键帽上的字符。这样的字母可能是"元音字母变音符号(umlaut)","长音符号(macron)"或是字母标音(accents on letters):
教程已经在多个Kubuntu Hardy Heron 8.04.1系统上测试过了。进一步的信息可以在下列的链接和进一步信息小节找到。
修改对(几乎)所有程序,包括桌面环境、浏览器、OpenOffice.org和众多终端/字符程序(console/text only applications)有效。
如下的教程会设定一个<compose>键,,同时映射到<right logo>键(多数键盘上这个logo 是Windows logo)。
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.
现在我们继续,设置我们的窗口环境(Plasma)。这里用的是Kcontrol或叫 Kubuntu 配置工具,打开的是一样的设置对话框。
现在我们可以继续,设置我们的窗口环境(Plasma)。这里的描述中用的是系统设置(System Settings),通常能在 Kickoff 菜单中找到:
Gtk(例如 Firefox)和 Gnome 程序(Ubuntu 系统上)通常使用SCIM作为输入法,而非那种依赖(X)Compose 配置的XIM (X Input Method)。Therefore, you will often find that the "a" and "o" macron characters can yield the female/male ordinals "ª" and "º". 为了使其能同样有效,需要"告诉" GTK 程序使用 XIM。
对于单个程序,你可以这样做:只要设定程序的环境变量GTK_IM_MODULE值为xim:
$ GTK_IM_MODULE=xim firefox
对于单个 shell 会话永久的设置可以这样:
$ export GTK_IM_MODULE=xim
这条变量设置可以放到~/.bash_profile来设定单个用户下的G系程序都是如此,或是放到/etc/environment来设定全部用户都是如此。这种做法并怎么好,更好的方法在下面。
$ 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")-->
ß