Custom xkb layout in which one key creates two unicode code points

EDIT:

Still trying...

Testing shows that the keymap will ONLY take a single key in each position.

BUT, if you use a rare/never used keysym in the keymap definition, then a global Xmodmap to make THAT keysym output the various unicode characters you need, this'll work.

In the keymap:

key <AB04>  { [ v, V, XF86LaunchA, XF86LaunchB ] };

In a global Xmodmap: (perhaps loaded from /etc/profile.d ?)

keysym XF86LaunchA = U0056 U0331
keysym XF86LaunchB = U0076 U0331

There are quite a few unused/special-use keysyms, I chose the LaunchA/B as an example.


On the other hand, you can attach to a given key the unicode combining diactityics character itself, and then you can type it after any other character. Indeed that is the way the unicode combining characters are suposed to work.

In X11 there are dead keys, dead keys work the other way: first the dead key, then the base letter. There is a <dead_belowmacron>, you can attach it to some key.

Then you need to edit the Compose file for your locale (if someone knows how to append definitions to Compose file from a user defined location I would apreciate), and add lines like:

# when the output is a single unicode char, you put also the corresponding
# X11 symbol name
# <symbol> <symbol> : "one-char-string" <symbol>
<dead_belowmacron> <d> : "ḏ" U1E0F
<dead_tilde> <n> : "ñ" <ntilde>
# when the output is a multicharacter string, you put just the string
# <symbol> <symbol> : "string"
<dead_belowmacron> <v> : "v̱"

the Compose file to use is defined by locale in the /usr/share/X11/locale/compose.dir file (path may vary).