[Xcb] looking up the right keysym and retrieving printable chars

Rémi Denis-Courmont remi at remlab.net
Tue Feb 9 02:31:17 PST 2010


On Mon, 8 Feb 2010 22:05:27 -0800, Jamey Sharp <jamey at minilop.net> wrote:
> 2010/2/6 Rémi Denis-Courmont <remi at remlab.net>:
>> I believe I have the full table here:
>>
>
http://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_output/xcb/keysym.h;hb=HEAD
>> generated with that:
>>
>
http://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_output/xcb/keysym.c;hb=HEAD
> 
> I'm not clear on what this header is useful for,

It is just a list of all X keysyms that correspond to a Unicode code point
but:
 - are not part of ISO-8859-1, and
 - are not following the "new" X11 rule for Unicode code point.

VLC uses it to convert X11 keysyms to UCS-4/UTF-32
(VLC uses plain UCS-4 to represent keys internally independent of the
platform):

 if (keysym < 0x100) :
 then return keysym,
 else if (keysym > 0x01000100 && keysym < 0x0110ffff) :
   then return (keysym - 0x01000100),
 else lookup keysym in the above mentioned table.

The table could probably be shrunk a bit, as a few "sub-ranges" appear to
match Unicode with a constant offset.

> but I wondered, is it
> something you want to contribute to util/keysyms?

I don't mind. I can do it if someone else wants. I guess it would be one
step closer to replacing XKeysymToString.

-- 
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis



More information about the Xcb mailing list