Page 1 of 1

ERROR on LINUX: Could not find win32 key for x11 key

Posted: Thu Feb 01, 2007 10:30 pm
by sir_gon
when I press some keys, I get this error and a segmentation fault.
this happens when I press keys like a "º" or "¡", etc...
with letters and numbers it does not happen.

is possible to modify the code of irrlicht so that it does not do anything if it does not recognize some key?

My keyboard is es_ES (Spanish, Español). (I from Chile :D)
Distro: Kubuntu Edgy 6.10
Kernel: Linux 2.6.17-10-generic #2 SMP

Posted: Thu Feb 01, 2007 11:48 pm
by vitek
Is it crashing in your code or somewhere in Irrlicht code? You might try to initialize irrevent.KeyInput.Key to 0 before doing the KeyMap search in CIrrDeviceLinux.cpp at about line 740.

That way when an unknown key is pressed the key code is still valid. Lots of code assumes that there are only 256 key codes, but the EKEY_CODE enumeration will allow for many more than 256 different values. When a value outside the range of [0, 255) is used on a 256 element array... boom.

Travis

Posted: Fri Feb 02, 2007 8:25 am
by CuteAlien
If you just want to supress the output you can outcomment or remove the following two lines in CIrrDeviceLinux.cpp:

Code: Select all

else
    os::Printer::log("Could not find win32 key for x11 key.", ELL_WARNING)
But there's a better way to do stuff. Instead of removing those lines do exchange them by the following lines:

Code: Select all

else
{
    core::stringc missingKey("Could not find win32 key for x11 key ");
    char dummy[16];
    sprintf(dummy, "%x", mp.X11Key);
    missingKey += dummy;
    os::Printer::log(missingKey.c_str(), ELL_WARNING);
}
Now it will print the keycode which is missing and you can look that code up in keysymdef.h (usually found in /usr/include/X11/keysymdef.h). Add the keycode to CIrrDeviceLinux::createKeyMap and it will no longer be unknown.

Posted: Thu May 01, 2008 11:21 am
by FLUF
I lose many time for resolve this problem, and failure. I want Cyrillic symbols in my irr-project. I use CGUITTFFont for display it. But also I want write cyr in edit box. Do you give my *.patch for it for 1.4 irr? Or tell my, plz, how it made?

Posted: Thu May 01, 2008 11:58 am
by CuteAlien
I haven't done that yet for 1.4, but maybe that gets you started:
http://irrlicht.sourceforge.net/phpBB2/ ... highlight=