A while ago someone posted a patch for Unicode input in the X11 driver:
http://lists.arabeyes.org/archives/developer/2004/June/msg00160.html
I’ve cleaned it up to work with SDL CVS, but it fails to fill in the
“unicode” field for key release events (as the documentation for
Xutf8LookupString() says it will), so I can’t commit the patch, since
that’s technically a downgrade from what SDL currently does.
Maybe the reason Xutf8LookupString() has undefined behavior when passing key
release events is that the unicode value has no meaning in this context.
I think, and please correct me if I’m wrong, that SDL doesn’t fill the unicode
field anyway for key release events because of the above reason and thus the
patch cannot really be considered a downgrade.
This has been discussed before in this thread:
http://www.devolution.com/pipermail/sdl/2005-January/066891.html
If someone can fix this somehow, I’ll commit it to CVS, otherwise, the
updated patch is attached for those that have a personal need for it.
Thanks for taking the time.
Anyway since the manual says that Xutf8LookupString() has undefined behavior
when passing KeyRelease events, I modified this updated patch to check the
type of the event before calling Xutf8LookupString() by replacing the line in
the X11_TranslateKey function that reads:
if (ic == NULL) {
with:
if (ic == NULL || xkey->type != KeyPress) {
Thanks again :-)On Friday 18 November 2005 03:22, Ryan C. Gordon wrote:
–
Mohammed Yousif
Egypt
“??? ??? ??? ??? ??? ?? ???. ??? ??? ??? ???. ??? ??? ??? ???
??? ??? ???. ??? ?? ??? ???. ??? ??? ?? ??? ???. ???
??? ?? ??? ???. ??? ??? ??? ??? ?? ???” (?? ??? ???)
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-x11-utf8-keys.txt.zip
Type: application/x-zip
Size: 5298 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051120/82c467ea/attachment.bin