wiki:InputMethods

Input Methods

European users input national characters using keyboard layouts configured via XKB. BLFS already contains an example for Russia. However, XKB doesn't allow input of characters needed for East Asian languages. Special "Input Method" software is needed for this purpose.

While the hint on Setting up Japanese input and output for terminals and applications is still valid, approaches outlined there are out of fashion now. The setup below has the advantage of requring no system-wide daemons.

The following software is needed:

  • Anthy: converts Hiragana text to Kana Kanji mixed text. Needed for Japanese input only, otherwise it is optional.
  • SCIM. You may need the following modules:
    • SCIM itself: the daemon that provides the framework for text input (depends upon GTK+ 2.x)
    • scim-hangul: module that provides Korean input (depends on SCIM)
    • scim-pinyin: module that provides Simplified Chinese input (depends on SCIM)
    • scim-tables: module that provides table-driven input methods (many languages, depends on SCIM)
    • scim-input-pad: allows European users to enter various special, e.g., mathematical, characters (depends on SCIM)
  • SCIM-Anthy: module that provides Japanese input using the Anthy library (depends on SCIM and Anthy)
  • TTF fonts covering the desired languages: Chinese, Chinese (older, known to Fontconfig out of the box), Japanese, Korean.
  • Possibly other packages, but the above should be sufficient for Chinese, Japanese and Korean.

Build each of the packages you need in the order given above, with the following commands:

# As user:
./configure --prefix=/usr --sysconfdir=/etc
make

# As root:
make install

As root, update the GTK+2 input method module list:

gtk-query-immodules-2.0 | sed 's,ko:ja:th:zh,,' >/etc/gtk-2.0/gtk.immodules

The sed substitution above makes SCIM (instead of XIM, that would map to SCIM anyway, but has the potential of locking up the entire X session due to one buggy application) the preferred module for Chinese, Japanese, Thai and Korean. Alternatively, you can omit the sed substitution:

gtk-query-immodules-2.0 >/etc/gtk-2.0/gtk.immodules

but also configure GTK+2 to use SCIM by adding this line to /etc/profile.d/i18n:

export GTK_IM_MODULE=scim

The steps above would make SCIM available to all GTK+2 applications in the context menu of any editable field. To make SCIM available to non-GTK applications, the following steps are required:

  1. Add the following line to /etc/profile.d/i18n:
export XMODIFIERS=@im=SCIM
  1. Arrange the following command to start up in your X session before everything else:
scim -d

This would show the keyboard icon in the system tray area of your window manager. Click it or press Ctrl+Space to activate SCIM, press Ctrl+Space again to deactivate.

Japanese testcase from http://www.mc.maricopa.edu/~emiahn/howtotype.htm: Ctrl+Space gakkou Space Enter Ctrl+Space should produce 学校 (school).

Up
Top

Last modified 14 years ago Last modified on 03/26/2008 04:56:49 AM
Note: See TracWiki for help on using the wiki.