Monday, February 05, 2007

Saturday, February 03, 2007

Modifying keys with xmodmap

I have fat fingers, and my backspace ans insert keys are quite close to each other. And accidently pressing the insert key instead of backspace can be really annoying....All of a sudden you notice
your text is getting overwritten.

So, is there any way of getting rid of my insert key? Or better yet, can I replace Insert with Backspace? The answer: xmodmap

Here's what I did:

  1. xmodmap -pke > ~/.xmodmap.myown (This created my own xmodmap file)
  2. Open it in a text editor. Find where Insert is. (Keycode 106 in my case)
  3. Find the line with Backspace, and replace the insert value with backspace. In the end, it will look something like this: keycode 106 = BackSpace Terminate_Server


And incase you can't find which keycode is what, then you can run xev in a terminal. Press a key, and its info will be displayed on the terminal.

To use this new configuration, I ran the command: xmodmap ~/.xmodmap.myown

And so that I don't have to run it everytime, I put this command in my KDE autostart directory in a shellscript.

Pretty neat eh?