all in the pursuit of productivity
Friday, January 02, 2004, at 09:06AM
By Eric Richardson
One of the things I like least about laptops is the lack of a full 101 keys and getting stuck with two buttons. Today I got around to doing something about it.
There are two things that annoy me most about using my laptop. 1) No middle mouse button. 2) No right-hand Ctrl key. In Linux, which is what I use on the laptop 99.9% of the time, I use the middle button to paste and also an alt-middle drag combination for resizing windows. I use ctrl-(left|right) for desktop navigation, and tend to do this with just the right hand.
Thanks to some handy instructions found here, changing my keyboard mapping around to solve both of these problems was pretty easy. I won't bore the main page with the technical solution, but click to get it.
First, enable keyboard buttons via xkbset (linked off the above directions):
[eric@flynn src]$ xkbset m
[eric@flynn src]$ xkbset exp =m
Then use xev to figure out the keycodes you want to remap. My keyboard goes space, Ins, Del, Alt (R), arrows. I wanted Del to be a Ctrl (R) and Ins to be my middle button. Just to be safe, I moved Del and Ins to End and Home (respectively). :
[eric@flynn src]$ more ~/.Xmodmap
keycode 106 = Pointer_Button2 Pointer_Drag2
keycode 97 = Insert
keycode 103 = Delete
keycode 107 = Control_R
add Control = Control_R
Then just reload xmodmap, and you're all set. :
[eric@flynn src]$ xmodmap ~/.Xmodmap
Very cool.