Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it?
(or \"to use XGrabKey() without generating Grab-s
You could use XQueryKeymap to read the events, then you could use XTestKey to send a backspace key event and then the the key you want to be pressed. Better, you could register hotkeys for all the keyboard events and then generate the key event using XTestKey. BTW, KDE's "Custom Shortcuts" control module allows using shortcuts to generate keypresses. Source code.