Entry Info

This entry was published on Saturday January 29, 2005.

Tags

Search

My blog feed

Replacing Caps Lock key with Backspace

Published Saturday January 29, 2005.

I am always looking for ways of making my "computing environment" better and more efficient. A friend of mine (Ryan Doom) pointed out how rarely we used the Caps Lock key suggesting that I should assign the backspace key to it. This sounded like a good idea because right now I have to reach so far out to get to the backspace key (top-.......-right-......-hand corner...) so I decided to give it a try... In order to assign the backspace key to the caps lock key in Microsoft Windows you have to modify a registry key. Don't worry because SharpKeys can make this a breeze, with SharpKeys you don't have to know either the key codes nor the HKEY_BLAH/BLAH/BLAH...

By now I have been using my keyboard with the new assignment for a few months and got really used to it. I had to revisit this a few days ago when I decided to try out linux much more thorougly than I had before. Doing this assignment in linux was a little more work because I had to modify the keyboard layout file for console and then do another reassignment for X. Below is what I did to accomplish these two tasks; I am using Arch Linux with the default QWERTY layout so you might have to do a few things differently depending on the distro that you prefer...

To change the default keyboard layout

  1. cd
    to
    /usr/share/kdb/keymaps/i386/qwerty
  2. Copy the
    us.map.gz
    to a new file
    myus.map.gz
  3. Edit
    myus.map.gz
    using your favorite editor and change the line
    keycode 58 = Caps_Lock
    to
    keycode 58 = BackSpace
  4. Change the default keyboard layout file that will be used by editing
    /etc/rc.conf
    and changing the line that says
    KEYMAP=us
    to
    KEYMAP=myus

This will change the default layout for consoles, you can load the new layout immediately by running the command

loadkeys myus
otherwise the default layout will be loaded when you restart the computer. Now to change the layout in X

  1. Create a file called
    .xmodmap
    in your home directory with the following code
  2. ! Swap Caps lock and backspace.
    remove lock = Caps_Lock
    keysym Caps_Lock = BackSpace

  3. If you are already in X then just run
    xmodmap ~/.xmodmap
    . If not then start your favorite desktop environment and run that command.
I presonally prefer KDE and am still working on finding the best way to automatically run the xmodmap command when KDE starts. So far I have created a file that runs this command in the ~/.kde/Autostart but that didn't seem to work. I will do some more research and post an update once I get it figured out.

2005-04-28: You can easily install the keymap in debian using the

install-keymap
command.

Comments
2:45 p.m. Thursday February 10, 2005
(about 1 week, 4 days later) Reply
John Kyritses commented...
backspace key
y'know what works for me? not making any mistakes... ever. That way, I don't have to use the backspace key.
11:07 p.m. Sunday February 13, 2005
(about 2 weeks, 1 day later) Reply
farhan commented...
I wish!
Haha... I wish that was an option for me :)
5:04 a.m. Sunday February 13, 2005
(about 2 weeks later) Reply
Farhan Ahmad Chaudhry commented...
Wishing you good luck
Aslamu Alikum dear Farhan

It was nice to see the web page of my name sake. Keep it up and good luck with your studies.

Yours Sincerely
Farhan
Add new comment