View Full Version : XKeycodeToKeysym deprecated

06-17-2013, 05:44 PM
Following that :
and the fact that XKeycodeToKeysym is deprecated, here is a patch that replace the old call by a new call (without modifying the behavior)

As rombust explained, this patch as I proposed is wrong and shouldn't be applied.

06-18-2013, 07:15 AM
I am not convinced the patch is correct.

A minor point first: there is a memory leak bug because XGetKeyboardMapping requires an XFree()

Looking at the links, I get an impression that all the commentators are not entirely sure what is going on.

Yes, XKeycodeToKeysym is deprecated. I think that is a mistake. It is only a deprecated when Xkb is used. Since Xkb has been around for 17 years, we still should be using it.

Using "XGetKeyboardMapping" I feel is wrong. Internally it probably does exactly the same as XGetKeyboardMapping , except you specify a range. It just has not had a "_X_DEPRECATED" attached to it.

Xkb will be intercepting the keystrokes (somehow) and performing additional processing to them. Thus Xkb, and only Xkb will contain the "correct" keystrokes.

Thus we should be using Xkb version of XKeycodeToKeysym. http://linux.die.net/man/3/xkbkeycodetokeysym

There is a question, if Xkb is not available. But the OS would be so old, that it would not run ClanLib anyway :)

Note, according to Wikipedia, "Client programs not using this extension can deactivate it before connecting with the server", I don't think that's wise.