Custom keyboard layouts: adding a character for which no keysym is defined

A couple of years ago, I followed the custom keyboard layout howto, and have been in dvorak+bilingual+typographic bliss ever since.

I’d now like to add the thin non-breaking space (U+202F) as one of my alternate keys in my arsenal (which precedes colons and question marks when writing in French), but it appears that no keysym is defined for this character in /usr/include/X11/keysymdef.h, so it’s not clear to me how to go about adding it.

Any thoughts? Is there some way I can simply provide the Unicode number in the layout definition file? Or is there a way to define a new keysym?

Thanks in advance.


Yeah, it is possible to use the Unicode code directly in xkb keyboard layout definition files in /usr/share/X11/xkb/symbols/ or to use with keysym using this format U#### or 0x100####.

Example:

key <AD04> { [        r, R,           U200F,        U200E           ] };

Or to define new keysym:

xmodmap -e "keysym RLM = U200F"

For permanent keysym, add to ~/.xmodmap file:

keysym RLM = U200F

References:

  • Custom xkb layout in which one key creates two Unicode code points
  • FOSS Localization/Annex B: Technical Aspects
  • Creating and Compiling Custom Keymaps for Linux