I have developed a package called JPSupport that enables Japanese text input in the Lazarus source editor (SynEdit) on Linux/GTK2, without modifying Lazarus internals.
How it works:
Using gtk_key_snooper_install to globally intercept key events and forward them to a dedicated GtkIMContext, bypassing the limitation that synedit.ppu is compiled without the GTK2 IM flag in standard Lazarus builds.
Features:
- Preedit underline display
- Candidate window follows the cursor
- Works correctly with multiple tabs
- Supports both Fcitx5 and IBus (Mozc recommended)
Confirmed working:
- Raspberry Pi 4/5 (ARM64) / Debian 12 / Lazarus 2.2.6 / Fcitx5 + Mozc
- Raspberry Pi 4/5 (ARM64) / Debian 12 / Lazarus 2.2.6 / IBus + Mozc
- VMware Debian 12 (x86_64) / Lazarus 2.2.6 / IBus + Mozc
- VMware Debian 12 (x86_64) / Lazarus 2.2.6 / Fcitx5 + Mozc
GitHub:
https://github.com/53jouhikone-source/JPSupportFeedback and contributions are welcome!