Re: KeySym to Unicode?

2012-01-28 Thread walter harms


Am 28.01.2012 00:48, schrieb Troy Watson:
 Because Unicode was invented years after Xlib and no one ever went back
 to add such a thing?   Most of the Xlib API is codeset independent since
 it was written in the days when every locale used a different character
 set (ISO 8859-*, Big5, JIS, etc.), so you get a char buffer appropriate
 to the current locale.

 There were a few UTF-8 specific additions in later years, but mostly we've
 been trying to let Xlib rest in peace since then, pushing new API design
 towards xcb instead.
 
 Thank you for the definitive answer.
 
 Will such a function exist in XCB? I can't imagine any windowing
 system that wouldn't need such functionality, which is why GTK, QT et
 al. implement their own for Xlib. Looking at the code for Awesome
 Window Manger (which uses XCB) they have a simple keysym_to_utf8
 function already.
 
 I guess this is going off topic here and belongs in xcb-devel...


If you think it would be useful maybe you can prepare a patch  ?

re,
 wh
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: KeySym to Unicode?

2012-01-27 Thread Troy Watson
 Because Unicode was invented years after Xlib and no one ever went back
 to add such a thing?   Most of the Xlib API is codeset independent since
 it was written in the days when every locale used a different character
 set (ISO 8859-*, Big5, JIS, etc.), so you get a char buffer appropriate
 to the current locale.

 There were a few UTF-8 specific additions in later years, but mostly we've
 been trying to let Xlib rest in peace since then, pushing new API design
 towards xcb instead.

Thank you for the definitive answer.

Will such a function exist in XCB? I can't imagine any windowing
system that wouldn't need such functionality, which is why GTK, QT et
al. implement their own for Xlib. Looking at the code for Awesome
Window Manger (which uses XCB) they have a simple keysym_to_utf8
function already.

I guess this is going off topic here and belongs in xcb-devel...
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: KeySym to Unicode?

2012-01-25 Thread Troy Watson
On 1/24/12, Samuel Thibault samuel.thiba...@ens-lyon.org wrote:
 Troy Watson, le Tue 24 Jan 2012 17:36:10 +1000, a écrit :
 Does there exist a function in Xlib as simple as this...

 wchar_t unicode = XKeySymToUnicode( KeySym )

 ...to map a KeySym to it's Unicode equivalent? If not, why? What's
 available to achieve similar results?

 XkbTranslateKeySym?

 Samuel


Thanks for the reply - Is that what I want though? Looking at
http://www.x.org/releases/current/doc/man/man3/XkbTranslateKeySym.3.xhtml
it returns me a KeySym and a char buffer filled with... something. I
just want a keysym-unicode code point conversion. I'm starting to
think such a thing doesn't exist in Xlib, for some unfathomable
reason.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: KeySym to Unicode?

2012-01-25 Thread Samuel Thibault
Troy Watson, le Wed 25 Jan 2012 18:55:37 +1000, a écrit :
 Thanks for the reply - Is that what I want though? Looking at
 http://www.x.org/releases/current/doc/man/man3/XkbTranslateKeySym.3.xhtml
 it returns me a KeySym

See the text: it takes a keysym, and returns another one if the keyboard
state is supposed to change it.

 and a char buffer filled with... something.

Which is the best description of the keysym you can imagine.

 I just want a keysym-unicode code point conversion.

Convert the string to unicode then.

Samuel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: KeySym to Unicode?

2012-01-24 Thread Samuel Thibault
Troy Watson, le Tue 24 Jan 2012 17:36:10 +1000, a écrit :
 Does there exist a function in Xlib as simple as this...
 
 wchar_t unicode = XKeySymToUnicode( KeySym )
 
 ...to map a KeySym to it's Unicode eqivilent? If not, why? What's
 available to achieve similar results?

XkbTranslateKeySym?

Samuel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


KeySym to Unicode?

2012-01-23 Thread Troy Watson
Does there exist a function in Xlib as simple as this...

wchar_t unicode = XKeySymToUnicode( KeySym )

...to map a KeySym to it's Unicode eqivilent? If not, why? What's
available to achieve similar results?
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel