Monday 27 November 2017

ubuntu - Remap arrow keys to win+ijkl on linux


I'd like to remap arrow keys to windows key plus ijkl. I can do this easily in Autohotkey on windows, but I'm struggling on Linux (Ubuntu lucid).


I'd really like the solution to work independently of whether I'm using a window manager or not, and to involve modifying as few files as possible; I work on a lots of different machines and am always building new ones, so would like to minimise reconfig effort.


I've tried to understand .Xmodmap, but couldn't make it work (was hard to find detailed docs on modifier keys).


(Am also considering win+hjkl, but am probably not that hardcore)



Answer



Use xev to find out the key code for the modifier key(Win key in this case).


Let it be 66.


Make a file named Xmodmap (or whatever you like) with the following content.


keycode 66 = Mode_switch
keysym j = j J Left
keysym l = l L Right
keysym i = i I Up
keysym k = k K Down

Now load these mappings using xmodmap Xmodmap


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...