I have a feeling that I'm getting terribly misunderstood. In case my wording wasn't correct, I was referring to "XKB keynames" with the words "symbolic key names".
Ilya, I agree with you except for using the XKB API. Let me explain what my code is doing:
I made a perl script that reads the keycode -> XKB keynames. I understand the power of XKB key names, they provide a hardware independent naming for keys, somehow like virtual key codes. That is what we want to use, and not key syms. The reason why I am converting these maps to a different format is because XKB key names have to be mapped to virtual key codes so that they can be used more conveniently with rdesktop. So, my perl script exports part of the XKB maps to keycodes -> virtual key codes maps that are ready to be used by rdesktop, completely independent of an XKB-aware X server.
When we initially discussed this a few months ago, many people have expressed their concern that rdesktop should remain compatible with systems that do not have XKB. Instead of having one way for XKB-aware systems and a different one for those that have, I thought of a consistent one that would work for both. What I came up with was the idea of using only a small part of the maps of XKB in an easy to use format, and that I would write my own parsing functions to load it. This way, a system without XKB would be able to use my code without any problem, because we simply aren't depending on XKB or anything from the XKB API.
So, to clarify the obvious misunderstandings:
I am NOT adding any dependency on XKB, or using the XKB API or anything.
I am using the XKB key names, the names that make abstraction of the hardware itself to bring consistent naming of the keys. These are mapped to virtual key codes when the key maps are exported from the XKB configuration database. These new maps should then be included with rdesktop, they really don't take space and it allows us to support systems without XKB.
When rdesktop starts, it tries to detect the current keyboard type, and also the current keyboard layout. Keyboard layout detection is only used to announce to the server what keyboard layout to use. Keyboard _type_ detection is used to load the corresponding keycode -> virtual key code map.
So, once the keycode -> virtual key code map is loaded, rdesktop is able to map each keystroke directly to a virtual key code. The virtual key code is then mapped to a scan code that is sent. I suggest you take a look at my source code, especially keyboard.h and xkbkeymap.c, it should clarify things.