Qt::Key to Keycode on x11
-
I try to find a way to map dynamically and reliably an arbitrary Qt::Key to the corresponding Keycode (as defined in X.h).
In QxtGlobalShortcut this is done by translating the Qt::key to a X.h Keysym with @XStringToKeysym(QKeySequence(key).toString().toLatin1().data())@
and looking up the keycode with XKeysymToKeycode(). Hower, getting the correct string as input for XStringToKeysym() is more or less coincidence and it doesnt work for many keys (like space, dot, comma, ...).I'm sure there must be a better way.
Can anybody help? Thanks!