Xlib Programming Manual (O'Reilly & Associates, Inc.) Older manual on programming X-win. Includes a short program mapkey.c, which can be used to re-map keys as specified on the command line. Might be easily modified to map lots of keys permanently. with keyboardlinux
xmacroplay.cpp C++ source for Xmacroplay; this plays back a previously recorded file of keystrokes, button presses etc. (See xmacrorec2 and xmacroplay). with keyboardlinux