Input Method


Input Methods are most important components of Fcitx. It will process key event, and update the preedit string and set candidate words.

Every single input method addon can add more than one input method to Fcitx. Like fcitx-table, it will load table configuration files first, then add corresponding table input method.

Input methods are registered via FcitxRegisterIM. It will provide two strings, one is Name, which will be displayed directly to user. If addon want to have Name translated, it should do the translation before pass Name to FcitxRegisterIM. Icon Name is a property that will be used in UI display, the actual usage for Icon Name depends on the UI Module implementation. For fcitx-classic-ui, it will be used as the original png file name; for fcitx-kimpanel-ui, it will be used with a "fcitx-" prefix and look for icon in system icon themes.

Init will be called when a input method being switched to. ResetIM is usually being called in ResetInput. DoInput is the key function, which process the key event. And if the return state is IRV_DISPLAY_CANDWORDS, the GetCandWords will be called. Save will be called when fcitx want to save the data, usually when logout.

Priority control the order of input methods, each IM should take care of it's own priority value. If a priority value less than or equal to zero, this input method will not be registered to fcitx.