The first thing to do is to find out just what you get when you do your keystroke logging. That's not an X question, and I can't help with that, although Mr. Google might be able to, or someone might come along to this thread. Who knows?
Anyway, once you've figured out just what you're getting, you're in luck. Help should be as close as your bash prompt. Do this:
Code:
man X # upper case X
Then search for the word
keyboards
Read that whole section carefully. You'll notice that it distinguishes between keycodes, which can vary from one piece of hardware to the next, and keysyms, which do not vary that way.
You have two ways of going about this.
The more careful way is to find some way to translate from the keystroke logging to meaningful key data, find the data in
/usr/include/X11/keysymdef.h, convert from the keysym to the keycode, and use that keycode in
XSendEvent().
To do this, you might be interested in several of these functions:
Code:
XStringToKeysym()
XKeysymToString()
XKeycodeToKeysym()
XKeysymToKeycode()
XConvertCase()
The less careful way is to assume (perhaps after experimentation) that the data you get from your logger can be directly used as keycodes for X, and plug those into
XSendEvent() directly.
Your pick.