Mapping combo to key and key to combo

Glynn Clements glynn at
Thu Aug 27 05:37:09 PDT 2009

Matthijs Kooijman wrote:

> > This would mean I would have to set mapping per each application, 
> > undoable. I need something more low-level, system-wide, to "fool" any 
> > app that I am really pressing the assigned keys.
> Perhaps this should be achieved by an application that catches key presses,
> eats them and insert synthetic keypresses back into X? Not sure if this is
> exactly how it should work, or if there is already an app doing this... 

Most WMs include a feature to grab keys and associate them with
commands. FVWM also has a FakeKeypress command, but I couldn't mangage
to get this to work for modified keys.

Also, sending key events from an application will cause the event to
have the send_event field set, which allows the application to
distinguish a fake event from a real event (e.g. xterm ignores events
with the send_event field set unless the "Allow SendEvents" option is

It may be possible to use the XTest extension (i.e. XTestFakeKeyEvent)
if you need to generate events which don't have the send_event field

Glynn Clements <glynn at>

More information about the xorg mailing list