Adding multiple characters by a single keypress in X11 with XKB.

Ran Benita ran234 at
Sun Feb 23 13:08:49 PST 2014

On Sun, Feb 23, 2014 at 07:58:27AM +0600, An-Najmus Saqib wrote:
> Dear Xorg Volunteers,
> I use a third-party software for Bengali typing in Windows named Avro
> Keyboard. It provides a graphical keyboard layout editor (only in
> windows-version, linux version supports only phonetic bengali typing).
> I made my own layout with it as well as I'm using it for several
> years. And I can type multiple Unicode characters with it (for Bengali
> conjuncts).
> A few months ago I started using Ubuntu (12.04). One of the biggest
> problems I faced it was my Bengali typing. Then I started googling and
> found here a way to make xkb layout in Ubuntu. Now I am writing a new
> bengali custom keyboard layout in xkb. In Bengali I need to add some
> conjuncts in my layout which is made up by multiple unicode
> characters. How can I type those characters in a single keystroke? In
> my layout I need these characters :
>    key <AD04> { [   U09B0,  U09CD_U09B0,  U098B   ] }; // BENGALI RA,
>    key <AB01> { [   U09AF,  U09CD_U09AF           ] }; // BENGALI YA,
>    key <AB02> { [   U09B7,  U0995_U09CD_U09B7     ] }; // BENGALI SSA,
> I searched the Internet, most of answers were about xim by editing the
> compose file; it looked like a per-use setting. But I to use it
> systemwide by xkb.
> And  my Arabic layout because UFEFB is not supported (in search
> option), so I need to use U0644_U0627.
> Here I got that xkbcommon supports a syntax like this (but it's not
> supported in X11) :
>        key <HELO> { [ h, i, { h, e, l, l, o }, { H, E, L, L, O } ] };
> // to produce 'h' from level 1, 'i' from level 2, 'hello' from level
> 3, and 'HELLO' from level 4.
> Is there any alternative syntax for this in X11?

No, X11's XKB doesn't support multiple-keysyms per level. The solution
up to now is to either use pre-composed unicode codepoints (which is not
always possible), or to use the Compose mechanism.

But Compose should work generally, the only problem here that I know of
is GTK not using the user's Compose file by default; but that can be
fixed by setting GTK_IM_MODULE=xim. I know Qt5 uses the system's Compose
files, not sure about older Qt's.
Did you run into any problems with this approach?


More information about the xorg mailing list