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 )
Distro: Kubuntu Edgy 6.10
Kernel: Linux 2.6.17-10-generic #2 SMP
ERROR on LINUX: Could not find win32 key for x11 key
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
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
If you just want to supress the output you can outcomment or remove the following two lines in CIrrDeviceLinux.cpp:
But there's a better way to do stuff. Instead of removing those lines do exchange them by the following lines:
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.
Code: Select all
else
os::Printer::log("Could not find win32 key for x11 key.", ELL_WARNING)
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);
}
I haven't done that yet for 1.4, but maybe that gets you started:
http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm