X11 KeySym to Unicode mapping?

Shaheed srhaque at iee.org
Wed Oct 29 21:33:22 GMT 2003


On Wednesday 29 October 2003 17:56, David Faure wrote:
> On Wednesday 29 October 2003 18:47, Shaheed wrote:
> > Hi,
> >
> > After much scratching of head, I finally realised that an X11 KeySym is
> > not the same as a Unicode value (of course its *obvious* when you think
> > about it!). The closest thing to a mapping I can find is:
> >
> > http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.c
> > http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.h
> >
> > But the question is, is there already an equivalent mapping somewhere
> > else in KDE or Qt, or should I just add these files to kdenonbeta/viki?
>
> XLookupString ?
> For the full story see QETWidget::translateKeyEventInternal in
> qapplication_x11.cpp

Oh crap. Its worse even than QETWidget::translateKeyEventInternal(). AFAICS, 
languages such as Bengali are completely missing...and more research on the 
web turns up links like this:

http://cvsweb.xfree86.org/cvsweb/xc/lib/X11/imKStoUCS.c

with what looks like more of the story. Unless someone has a better idea, I'll 
have to see if I can find a synthesis for all this. 

For the record then, I'm going to try[1] to build a translation module from 
X11 keysyms to Unicode. I'll stick what I come up with in viki for now, and 
we can consider if anyone needs this moving to (say) kdecore/kkey* in 4.0.

Thanks, Shaheed

[1] To my increasing chagrin, even keysymdef.h does not seem to have Indic 
keysym symbols. Any pointers appreciated...




More information about the kde-core-devel mailing list