[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I make my caps lock key act like a control key?

From: ken
Subject: How can I make my caps lock key act like a control key?
Date: Wed, 16 Jul 2008 02:53:10 -0400
User-agent: Thunderbird (X11/20070326)

This is more a Linux systems question than an emacs problem. But hopefully no one here will be too offended.

As with most things unix and, more, linux, there's a number of ways. What I've done is swapped Control and CapsLock in the system file where they are initially defined, in /usr/share/kbd/keymaps/i386/qwerty/. Depending upon your machine (uname -m) and how it's set up, the file you want to look at might be in a different directory. On some Linuxes you can find the file with "cat /etc/". If this works for you, then you should just be able to hand edit /etc/ it should be obvious what editing needs to be done. If I'm remembering correctly, you'd just want to change the line beginning

keycode  58 =

to read "Control" instead of "Caps_Lock".

Alternatively, you could make a copy of your preferred keyboard map in or around /usr/share/kbd/keymaps/i386/qwerty/ (naming it, say,, edit that file in the same sort of way as above, and then write in into /etc/

Because these are a system files, the key(s) are swapped for anyone using this machine without X (which, for all practical purposes on my system, is just myself).

There's other ways to do what you want... query a search engine for them if you're interested in alternative, probably more doctrinaire methods.


I am having trouble mapping my caps lock key to control key in my linux
shell(NOT X). I want both the control and caps lock keys to act like control
keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
it to work.  I've used dumpkeys to get a keymap, edited the map to where
both the caps lock and control keys have the same key code (58 i think).  I
then load this map with loadkeys and there are no errors but nothing
happens.  I tried opening a new shell just in case and still no changes have
Help on this issue would be appreciated.
View this message in context:
Sent from the Emacs - Help mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]