Your presentation on LibreOffice code

Jan-Marek Glogowski glogow at
Sat Mar 21 18:26:20 UTC 2020

Am 21.03.20 um 18:02 schrieb Arvind Kumar:
> On Fri, 20 Mar 2020 Jan-Marek Glogowski wrote:
>> Hmm - I know fcitx uses some kind of tables for the direct mappings. My
>> Debian has fcitx-table-emoji. Guess that would be the easiest starting
>> point, if your languages typed letters don't depend already existing
>> previous or next letters and just need some keys to code point mapping.
> There are two separate issues here - keyboard input and display of the
> glyph. Leaving aside for the moment the input mechanism assuming that I
> have done what you suggest, I'd like to understand the code dealing with
> the display mechanism in LO. This is because even if some external
> method did the input mappings and the keycode came into LO as a result
> of those mappings, the problem here is that although everything works
> fine in the case of copy-paste, it is not the same with keyboard input.

[more stuff, I think is not relevant here. But I have just limited
knowledge of the whole IM stuff, as I just implemented IM handling in

>From my POV it's just a single issue. I think you try to sole a
non-existing problem. LO uses UTF-16 as its internal string
representation (OUString), which is also length encoded. And you already
wrote CnP of your text works.

And X11 based input methods aren't restricted to either virtual or real
key codes, but can also insert "text". For some IM key events you'll get
a text value with length > 1 for these composed  input cases. Commit
1c6ea413cb01c0b482f87e625ba208eec230618a ("tdf#130071 tdf#127815 qt5:
Use ExtTextInput only for multi-char key events") has some more
explanations for the recent fix to the Qt5 backend.

I tried to find some good architecture overview of X11 / xorg, input
methods and keyboard handling, but couldn't find any, except references
to some book (XLIB Programming Manual). But maybe the compose key
handling is sufficient as a start for your case[1].

>From all I know, there is no need to change anything in LO or even Gtk.
You "just" have to develop a "plugin" for your preferred IM system. And
I have no knowledge, about that, so best contact the people of your
preferred IM implementation.




More information about the LibreOffice mailing list