Search:  
Gentoo Wiki

Input_Methods

Contents

Character set support

You will have to ensure that your character set includes all the characters that you will be inputting. Input Methods are commonly used to input CJK (Chinese, Japanese and Korean) characters which will then require UTF support.

If this applies to you, follow the official Using UTF-8 with Gentoo guide, or the Wiki page on the same subject.

This isn't complicated, but if you move to UTF-8 you'll want to spend some time ensuring that current applications work properly. Both resources above have a lot of information about application support.

USE flags

Below are the USE flags you may need to add to your /etc/make.conf.

cjk Stands for 'Chinese Japanese Korean'. Enable this if you intend to use any of these.
nls Native language support. Enables other languages in application interfaces. [Not sure if this is necessary. If you don't have this already, you may want to check if installing goes OK without and report back -- I need it already for my native language.]
immqt or immqt-bc Enables the qt-immodule for Qt 3 (there is a native immodule in Qt 4). These flags are mutually exclusive so make sure only one is set.

Unless you are prepared to recompile all programs that depend on Qt 3, you will want to choose the binary compatible immodule (immqt-bc).

Ensure that all your currently portage-installed packages are compiled with up-to-date use flags:

emerge --newuse world

This may take a while...

Input Methods

The Input Method we'll be installing is uim (with the optional step of adding SCIM as a front end).

Uim comes with several input methods but others have to be installed seperately (this page has a list of input methods that work with uim). Luckily, Gentoo USE flags (and ebuild writers) come to the rescue as you can select the external modules by choosing the local uim USE flags. You can check the available ones by running:

emerge --pretend --verbose uim

Once you've added the USE flags to /etc/portage/package.use, e.g.

File: /etc/portage/package.use

app-i18n/uim anthy prime

you can install uim and all of the dependencies with:

emerge --ask --verbose uim

and you're done!

Make sure that you have a default input method enabled by running uim-pref-gtk or uim-pref-qt.

Graphical Input Method selection

You can choose to use either UIM to handle the IM selection, or install a frontend like SCIM.

UIM IM selection

Once everything is set up, just fire up either:

SCIM IM selection

SCIM, the Smart Common Input Method, provides an alternative taskbar icon and menu for switching between input methods.

emerge scim-anthy

Qt needs an aditional step to use scim - emerge scim-qtimm. GTK+-only users do not need to do this though.

If you need Qt4 support, then use app-i18n/scim-bridge with qt4 USE flag - emerge scim-bridge

Adding this line also helped for Qt4 :

File: ~/.config/Trolltech.conf
[Qt]
DefaultInputMethod=scim-bridge

Setting environment variables

Now that everything is installed, we just need to tell everything to use either uim or the SCIM frontend. If you use a session/login manager, you may have to place these in ~/.xsession or ~/.gnomerc instead of ~/.xinitrc.

uim only

File: ~/.xinitrc
export XMODIFIERS=@im=uim
export GTK_IM_MODULE=uim
export QT_IM_MODULE=uim

SCIM frontend

File: ~/.xinitrc
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim

If you have emerged scim-bridge for Qt3/Qt4:

File: ~/.xinitrc
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim-bridge
export QT_IM_MODULE=scim-bridge

Also, if you have problems with KDE, use not ~/.xinitrc but KDE-global /usr/kde/3.xx/env, e.g. /usr/kde/3.5/scim.sh.

Wrapping up

To actually use your input method, you will at have to env-update; source /etc/profile and restart X11; you probably will have to reboot.

Once you have done so, start up any program and you should see a little keyboard icon appear in your taskbar. Press the default "Ctrl+Space" to switch input methods.

You will probably notice that applications now take a little bit longer to load because scim gets loaded before every application. For those of you who are impatient, check out UIM which apparently loads faster.

Once you are using an input method, like uim-anthy, there several modes to choose from: raw input, hiragana, katakana, half-width katakana, and a typewriter-like variation of the latin alphabet. Start typing in Hiragana mode, and you text will be converted as the appropriate kana are found. The spacebar brings up a list of possible kanji and cycles through it, and hitting enter accepts and uses the replacement. More keyboard combinations are at uim-anthy.

See also

References

Retrieved from "http://www.gentoo-wiki.info/Input_Methods"

Last modified: Tue, 23 Sep 2008 10:13:00 +0000 Hits: 8,408