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

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
sir_gon
Posts: 13
Joined: Mon Oct 23, 2006 12:38 am
Contact:

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

Post 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
Mi blog y Portafolio: http://devgon.wordpress.com
Image
Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
FLUF
Posts: 14
Joined: Fri Jan 12, 2007 11:32 pm
Contact:

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I haven't done that yet for 1.4, but maybe that gets you started:
http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply