Hello everyone,
Some of you may know JPSupport, a package I released a while back that
adds Japanese input method (IME) support to SynEdit on the GTK2
widgetset:
https://github.com/53jouhikone-source/JPSupportSince GTK2 is end-of-life and GTK3 currently lags behind on IME
support, I've started porting the same kind of support to Qt5 and Qt6,
using Qt's standard input method API (QInputMethodEvent /
QInputMethodQueryEvent) instead of GTK2-specific hacks. The result is
JPSupport-Qt:
https://github.com/53jouhikone-source/JPSupport/tree/main/JPSupport-QtUnlike the GTK2 version (a standalone package), this one requires
patches to LCL core (lmessages.pp, components/synedit) and the Qt5/Qt6
interface layers, plus small C++ extensions to the bundled libQt5Pas/
libQt6Pas binding libraries - QInputMethodEvent::attributes() (needed
for bunsetsu/segment info) wasn't exposed at all upstream.
What's implemented and tested (on Fcitx5 + Mozc, across Raspberry Pi
4/5 and x86_64/Ubuntu):
- Fixed a commit-string truncation bug (UTF-16 was being misread as
UTF-8, dropping multi-character CJK input)
- Both IME toggle keys work (Ctrl+Space, Zenkaku-Hankaku)
- Candidate window follows the cursor instead of a fixed position
- Preedit (composing) text is actually shown - previously nothing was
rendered at all for SynEdit
- Bunsetsu (segment) highlighting and cursor tracking within the
composing text
IBus + Mozc also works, with a couple of known limitations documented
in the repo (Ctrl+Space conflicts with the IDE's own Code Completion
shortcut; the candidate window doesn't follow the cursor, which looks
like a limitation on IBus's own Qt integration side).
The repo includes both a patch script (for applying directly to a
fixes_4 checkout) and ready-to-run Docker environments for trying it
without touching an existing installation.
I'd love to hear the team's thoughts on whether this would be a
reasonable candidate for upstreaming, and if so, what the right next
step would be (a GitLab issue, a merge request, or something else).
Happy to answer any questions about the implementation.
Thanks for reading!