help with X11/keysymdef.h

Samuel Thibault samuel.thibault at
Wed Apr 23 15:36:49 PDT 2008

nidujay, le Thu 24 Apr 2008 08:26:26 +1000, a écrit :
> >  When, because of an input method, a keysym is converted into several
> >  unicode characters, it's the input method's matter. Keysyms are just the
> >  input for input methods.
> >
> So if a key on the keyboard is labelled 'X' and the input method
> generates the Unicode characters A + B + C, should keysymdef.h contain
> 1) #define XK_{language}_X  {value} ?
> or
> 2)
> #define XK_{language}_A  {Unicode char A}
> #define XK_{language}_B  {Unicode char B}
> #define XK_{language}_C  {Unicode char C}
> (Note A, B or C may not even have associated keys on the keyboard layout)
> If the former, is the value up to the implementer or are there
> guidelines dictating what is acceptable?

The former. The value is up to the implemeter, it just needs to not
clash with other keysyms.

The latter doesn't make sense: keysyms are really meant to designate
keys and nothing else.  You would only define XK_something_A if somebody
in the world produces a keyboard with a key labelled A.

> >  > The reason I'm asking this is because of the following comment in keysymdef.h:
> >  >
> >  >  * Where the correspondence is either not one-to-one or semantically
> >  >  * unclear, the Unicode position and name are enclosed in
> >  >  * parentheses. Such legacy keysyms should be considered deprecated
> >  >  * and are not recommended for use in future keyboard mappings.
> >
> >
> > That's because keyboard manufacturers have invented keys, unicode has
> >  invented characters, and some are quite the same, but not exactly, so
> >  the unicode position is given as a hint, but since the meaning is not so
> >  clear, these keysyms should not be used.
> I'm talking about a standardised keyboard layout for the language I'm
> working on.

Then for keys that exactly correspond to a unicode character, just use
the unicode value for it, like

#define XK_Abelowdot                  0x1001ea0  /* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */

For keys that don't correspond exactly to a unicode character, invent a
keysym for each of them.  The values has to be allocated within the
keysym space. The translatioin from keysyms to unicode characters will
then be up to the input method.


More information about the xorg mailing list