How fcitx/fcitx5-unikey works
This repository provides a Fcitx5 Vietnamese input method: typed keys are handled in an input context, transformed by Unikey’s composition engine, and returned as text for the application. Users can configure input method, output charset, spelling and macro options; Qt editors support macro and custom-keymap management. The sampled code confirms the Fcitx integration and engine adapter, but not all conversion, persistence, or macro-loading internals, so those connections are shown only where supported.
Main entry points: unikey-im.cpp Unikey addon · ukengine.cpp Composition engine · unikeyinputcontext.cpp Input adapter · editor.cpp Macro editor
Components 16
Fcitx integration
- Unikey addon
src/unikey-im.cpp - Input state
src/unikey-im.cpp - Addon configuration
src/unikey-config.h
Input engine
- Input adapter
unikey/unikeyinputcontext.cpp - Composition engine
unikey/ukengine.cpp - Key processing
unikey/inputproc.cpp - Charset conversion
unikey/charset.cpp - Macro table
unikey/mactab.cpp - User keymap
unikey/usrkeymap.cpp
Qt editors
- Macro editor
macro-editor/editor.cpp - Macro model
macro-editor/model.cpp - Keymap editor
keymap-editor/editor.cpp - Keymap model
keymap-editor/model.cpp
Other components
- User
- Fcitx host
- Text application
Connections 17
- User → Fcitx host: types keys
- Fcitx host → Unikey addon: dispatches events
- Unikey addon → Input state: handles keys
- Input state → Input adapter: filters input
- Input adapter → Composition engine: processes keys
- Composition engine → Input adapter: returns output
- Unikey addon → Addon configuration: loads settings
- Unikey addon → Input adapter: configures method
- Input adapter → Text application: provides text
- Composition engine → Key processing: uses mappings
- Composition engine → Charset conversion: converts output
- Composition engine → Macro table: matches macros
- Unikey addon → User keymap: reloads keymap
- User → Macro editor: edits macros
- Macro editor → Macro model: updates entries
- User → Keymap editor: edits keymap
- Keymap editor → Keymap model: updates mappings