Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to remap IJKL to the arrow keys while alt is down.

Also, modifiers should still work ie: Shift+Ctrl+Alt+L should map to Shift+Ctrl+RightArrow

I was able to get this working using xbindkeys + xvkbd, but it wasn't working well because it looks like I lose focus every time it sends input, and it didn't work at all in the terminal.

share|improve this question
Heya, did you ever figure out a good way to do this kind of thing? – Owen_R Jun 6 '14 at 17:55
xbindkeys + xvkbd is still the best solution I've found, so no /: – Stephen Bugs Kamenar Jun 6 '14 at 20:03

There are a several more technical ways to do this that I have seen in other SE posts, but one of the easiest ways would be to install AutoKey. It is a full featured keyboard macro processor and it's easy to define simple macros for such a task.

AutoKey does a whole lot of other things easily and, if you know Python which is used as its macro language, you can get a keypress or phrase to do almost anything your system is capable of. And, it works with just about any program because, by default, its output appears to be coming directly from the keyboard exactly the same as if you were typing it.

Try it and see if it works for you. We don't currently have any developers on the project, but the support list is active and many people are successfully using it.

I just reread your question more carefully and the bit about the other modifier keys still working makes it more complicated because you would probably have to code a separate macro for each modifier combination with each key (i, j, k, l), but I think it would still work.

If you decide to try it, make sure you have the latest version (0.90.4) as many distros provide older versions that don't work as well.

share|improve this answer
I tried AutoKey before, but it wasn't consuming input, remapping Alt + I to right arrow key worked, but it still executed Alt + I, which sometimes selects an item from the application menu. Do you know if this is still an issue? (Maybe I was using an old version or did something wrong) – Stephen Bugs Kamenar Nov 28 '13 at 20:42
Don't know. Was it version 0.90.4? If you post your question on our forum/list!forum/autokey-users (preferably including a trace generated by running autokey-gtk -l from a console), maybe someone will be able to solve the problem. – Joe Nov 30 '13 at 7:30
So, I don't have that application menu issue with autokey anymore. But it does have the same issue as xbindkeys of losing window focus quickly when it executes, and the performance of it is so bad it lags my computer. But it does work in the terminal. If I can figure out the performance issue, that's not too bad. – Stephen Bugs Kamenar Dec 1 '13 at 20:24
Again, you may want to post to our list. I have had a number of problems using AutoKey, but performance has never been one of them. I'm not sure what you mean by losing window focus, but if it's what I think it is, it may be a problem generic to desktop environments when any gui program uses another gui one to get things done. I have a problem that sounds similar with yad (zenity fork) pop-up dialogs issued from bash scripts. – Joe Dec 2 '13 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.