Advanced Keyboard Layout Control – Beyond XKB

keyboardkeyboard shortcutsxkb

I am starting to run up against the limits of XKB, the keyboard subsystem of the X window system.

I would like to know if there is a way I can gain more flexibility. Here are examples of the kind of freedom I would like to obtain:

  • When pressing CapsLock+w, generate Ctrl+Right.
  • When pressing f d in rapid succession (but not slowly), generate Escape.
  • When pressing Ctrl+Space, generate 4 spaces.

What are some ways I could obtain this? Is there a replacement for XKB? Should I simply modify XKB itself? Is there a way to get closer to full programmatic control of the keyboard behavior?

Best Answer

Employ an extensible input method framework such as scim or ibus. The last one is possible out of the box by configuring the m17n backend, but I suspect the first two require you to program your input method.

Related Question