LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-07-2008, 04:23 PM   #1
tate1615
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Rep: Reputation: 0
How can I map the control key to the caps lock key in Linux?


Hi,
How might I map the control key to the caps lock key?
I need the caps lock key to function as the control key does from the command line as well as in programs run from the command line such as emacs.
I have found some information on the topic, but have not had any success in doing so.
Thanks,
 
Old 07-07-2008, 06:05 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
For emacs without X, see the emacs docs.

From any of the desktops, it can be done through GUI

KDE --> control Center --> Regional & Access.. --> Keyboard Shortcuts. There is the layout option too


Best

A. Mani
 
Old 07-07-2008, 06:10 PM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
You want to map the caps lock key to control, not the other way around.

Emacs can be run either in a text console or in X (graphics mode); the instructions for remapping keys differs.

The text console uses a program called loadkeys and X uses xmodmap.

Some examples: http://www.faqs.org/docs/Linux-HOWTO...HOWTO.html#s15

Note that when using loadkeys, you will need to be root and also press ctrl+D at the end of the instructions. Or you can save the instructions to a file and run
Code:
cat file | loadkeys
Edit: Amani points out that you can use the KDE menus instead. Gnome, as far as I can tell, does not have this option, but if you use KDE then that The menu may be simpler than editing the .xmodmap file.

Last edited by rjlee; 07-09-2008 at 05:43 PM. Reason: Update post to comment incorrect info
 
Old 07-08-2008, 07:42 PM   #4
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,191

Rep: Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815
Gnome does have this: Enter the menu at

System - Preferences - Hardware - Keyboard

choose the tab "Layout Options" and then the option "Ctrl Key Position".
 
Old 07-14-2008, 02:20 PM   #5
tate1615
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Question Still can't get the maps working in the console

Thanks All for all the help thus far!
I can successfully map the keys in the xmodmap...but am having ZERO luck in the plain ol' console. I followed the examples and did:
% loadkeys
keymaps 0-15
keycode 58 = Control
keycode 29 = Caps_Lock
%
(Then exited w/ Control+d)
This produced no change. I opened a new shell and there were still no changes.

I also tried:
% dumpkeys > my_keymap
% cp my_keymap trial_keymap
% emacs trial_keymap
% loadkeys trial_keymap
%
This produced no change either...but when I went into emacs to look at the trial_keymap -- I could see the correct changes in the file.
I got no errors when I loaded with the `loadkeys trial_keymap` command.
But there was still no effect even after I opened a new shell!

Where can I go from here?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
map control key to caps lock in Xemacs gandalf3 Linux - Software 0 12-19-2006 11:05 AM
CAPS lock key is now my left-CTRL key?! andrew_cz General 2 05-03-2006 08:32 AM
How do I switch the caps lock key out? timcharper Linux - Software 2 08-05-2005 02:00 PM
caps lock key neo77777 Linux - General 4 02-02-2002 12:32 AM


All times are GMT -5. The time now is 10:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration