You are not logged in.
Currently, I have a lot of keybindings in awesome wm and xbindkeys that do things like map Super + k to raise an xterm. What I'd like is a keybinding that maps "jk" to do this -- one which doesn't impede my ability to type other words with j's in them.
I've tried/thought about xbindkeys, xdotool, and awesome's keygrabber module, and with all of them I end up with the following general problem: I'm trying to remap "j" to a function that does (pseudocode):
if nextKey == "k"
then execute "xterm"
else press "j", nextKeywhere the last line is obviously problematic.
The idea was inspired by vim on two counts:
(1) basically the point is that there are better alternatives to hitting modifier keys all the time;
(2) I can do
imap jk <something> and it Does The Right Thing.
However, I don't want WM-wide modal keybindings, because that would still mean pressing extra keys; what I want is vim's "imap", only globally.
I can't believe I'm the only one who's wanted this, and so I'm wondering if anyone here has managed to come up with a solution.
Offline
I suppose it'd be pretty easy to write a little tool that runs in the background and "filters" all keypresses and could do something like this. But if it's modeless, I imagine that'd be a real PITA to use.
What if you want to type the letters "jk" in a document, or email ... or use them in vim! Suddenly your previously desired global mapping is getting in the way.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I was imagining something with a timeout, like vim's imap. Not sure why this would be a PITA; again, in vim I have a lot of things like "imap jk <esc>" with a short-ish timeout and they never get in my way...
I guess I could look at Xlib, but (a) I was hoping there was a higher-level tool that could do things like this, because I'm really not a programmer, and (b) I still don't see how to get around the problem I hinted at above: if I have a keybinding for "jk", then that means I'm capturing presses of "j"; if I type "je" instead, then the program would have to emit "j" and "e" keypresses, and this "j" keypress would get captured again by my program, ad infinitum.
Offline