Synthesizing keyboard events

Samuel Thibault samuel.thibault at
Mon Dec 11 13:18:17 PST 2006


We would like to synthesize keyboard events.  For instance, synthesize
typing XK_at.  The problem we encounter is that on a lot of keyboards,
this is not available directly, but in combination with some modifiers.

- Calling XKeysymToKeycode(XK_at) is not sufficient, since it doesn't
give us the modifier mask to synthesize.
- Looping calling XKeycodeToKeysym() doesn't seem to be very useful: one
can one know the modifiers for reaching the given index?
- One possibility would be to call XkbTranslateKeycode() with every
modifier combination until one is found, but that's a bit slow...

Is there any direct way to get the keycode and modifier mask to be


More information about the xorg mailing list