KeyPress/Release and modifiers

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Jun 10 06:27:39 PDT 2007


Glynn Clements, le Sun 10 Jun 2007 13:56:22 +0100, a écrit :
> To perform the translation, I would suggest searching the mapping
> table returned by XGetKeyboardMapping(); unmodified keys should be
> preferred over modified keys.

But the user will probably almost always prefer to use the usual
asdfjkl; keys (hence a modifier is needed)...

> You could use XKeysymToKeycode(), but I don't know how that will
> handle the case where a KeySym is available on multiple keys. E.g. on
> a UK keyboard, XK_bracketright can be generated by key 35 (the "]"+"}"
> key) with no modifiers, or by key 18 (the "9"+"(" key) with AltGr. If
> the user chooses XK_bracketright, you probably want the former rather
> than the latter or both.

That's why the solution I proposed earlier is on KeyPress to remember
keycode was pressed for generating it, and on KeyRelease, to look for
the keycode for knowing what was released.

Sauel



More information about the xorg mailing list