title: hook into linux key event handling
body: <p>I want to hook into linux desktop key event handling.</p>
  <p>Pressing CapsLock should enter some sort of command line.</p>
  <p>Some of the commands I want to implement:</p>
  <ul>
  <li>d/x: Delete from current cursor position until character <code>x</code>. (inspired by vi)</li>
  <li>a: Goto to beginning of line, like pos1. (inspired by emacs).</li>
  <li>k: Delete until end of line. (inspired by emacs).</li>
  <li>...</li>
  </ul>
  <p>The commands should work in any text field: Browser, Mail Client, gnome terminal, ...</p>
  <p>AFAIK low level xmodmap won't help me here.</p>
  <p>Is something like this possible?</p>
  <p>Where do I need to place the hook?</p>
  <p>Current target platform is Ubuntu &gt;= 14.04</p>
  <p>Background: I want to keep my pointing fingers on F and J, and use the computer without looking at the keyboard. Works for A-Z since several years, but keys like Pos1/End are not easy to access.</p>
  <p>Please leave a comment if you don't understand a part of this question. Thank you.</p>
  <p><strong>Update</strong></p>
  <p>This question is only about how to hook into the key event handling. The other stuff (command line) is a different topic. How can you catch for example <code>CapsLock x</code>?</p>
  <p><strong>Update2</strong>
  I see there is no easy and straight forward solution. If you have no answer, but you know where I can find more help (like ask on mailing list FOO), please tell me.</p>
  <p><strong>Update3</strong>
  Since some people do not understand what I want, I try to explain it: If I use emacs or bash I feel like being in control if the computer: it is like flying, with only very few movements I can tell the computer to do what I want. Editing text in webbrowser textarea, LibreOffice or using thunderbird makes this feeling go away. Cursor movements are cumbersome, it does not feel like flying. I want to control the desktop, not just a single application, and keep my pointing fingers on the F and J keys.</p>
  <h1>Update 4: Solution: input-remapper</h1>
  <p>I found a great solution to it: <a href="https://github.com/sezanzeb/input-remapper" rel="nofollow noreferrer">input-remapper</a>. See my small article <a href="https://github.com/guettli/ten-flying-fingers" rel="nofollow noreferrer">Ten Flying Fingers (more comfortable touch typing)</a></p>