Architecture of Input Method Framework


All Input Method Frameworks have a very simple architecture, basically they receive Keyboard Event from Application, which can be also called "Client", then try to do some job with this Keyboard Event, like simply letting it pass, or to block it and commit a string to the application.

The way that Fcitx handles the keyboard event can be separated into 4 phases, PreInput, DoInput, PostInput, and Process Hotkey. All the Input Method, such as "Chinese Pinyin", will be called at the DoInput Phase.

Fcitx Addon can be separated into 4 categories, Frontend, Input Method, Module, and User Interface. Frontend receives key event and pass it to Fcitx; Input Method helps people input their Language with keyboard; Module can do anything via registering hooks; User interface will display the all necessary elements on the screen.