Mapping combo to key and key to combo

Matthijs Kooijman matthijs at
Thu Aug 27 01:29:04 PDT 2009


> generally speaking, that's (in the context of X) a feature of the 
> applications that you're using.  For instance, xterm supports this using 
> the X Toolkit's translations resource.  (Some other widely-used 
> applications offer no support for what you're asking - ymmv).
Hah, that's useful. I've been looking for a way to translate Ctrl-l to insert
λ for a while now, using the translations resource of xterm this now works:

UXTerm.vt100.translations:        #override \
  Ctrl <KeyPress> l: string(λ)

It seems this mechanism is also useful for what the OP wants, but it is indeed
application specific. You should therefore not try to map F13 to shift+home,
but map it to whatever function shift+home performs. I'm not so sure how to
get to the default translation table, this should probably be documented with
your application. For Xterm, you can find a list of possible actions to bind
to keys under ACTIONS in the manpage.

It took me a while to find a decent reference on translation tables. The X
Toolkit Programming Manual [1] provides some, in particular in appendix B [2].

When specifying multiple translations in a single table, don't forget to
separate them with "\n" (and also include another \ for line continuation).

UXTerm.vt100.translations:        #override \
  Ctrl <KeyPress> l: string(λ) \n\
  Ctrl <KeyPress> x: string(λ)

For the keysyms to use instead of "l" above, see [3].

Replying to another post in this thread, I don't think xmodmap and xbindkeys
provide a solution. AFAIK xmodmap only maps keycodes and keysims, e.g., single
keypresses without allowing to specify modifiers. xbindkeys only allows you to
bind keys to run programs, not other keys.

I hope this helps a bit, it did the trick for me anyway. Thanks!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <>

More information about the xorg mailing list