LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-24-2010, 02:55 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Remap Caps Lock key to ESC


I wanted to remap my Caps Lock key to ESC, both because I don't need the Caps Lock key and because it will make it easier to use vi.

I know how to do this in X, but is there a solution that will work in command line mode too?
 
Old 01-24-2010, 04:50 PM   #2
White Tea Citrus
LQ Newbie
 
Registered: Sep 2009
Location: Slovakia
Distribution: Trisquel 5.0 Dagda
Posts: 27

Rep: Reputation: 0
mapping keys in raw console

I'm sorry for not being more specific, I couldn't test this myself due to no access to a console, I found out however that there might be also /usr/bin/loadkeys in your distro, which works in a similar way to xmodmap.

I suggest trying to update your /etc/rc.local with loadkeys in your local test environment.
 
Old 01-24-2010, 05:47 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Original Poster
Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
I don't understand.
 
Old 01-24-2010, 09:04 PM   #4
White Tea Citrus
LQ Newbie
 
Registered: Sep 2009
Location: Slovakia
Distribution: Trisquel 5.0 Dagda
Posts: 27

Rep: Reputation: 0
Quote:
Originally Posted by MTK358 View Post
I don't understand.
My fault, what I meant is:
First of all, you need to find the Caps Lock & the Esc key's map. You could find it in x (my suggestion was you know how to do this), or if you can't, type showkey followed by pressing the Caps Lock & the Esc buton, or you can type showkey -h or man showkey as well for some guidance. Now, to set the keymap temporarily, I found out that the keycode app suites the purpose, so you can type:

keycode ""esc key code's map No."" = Caps_Lock
keycode ""esc key code's map No."" = "The Escape button"

Be sure to change them codes back after usage. Now, for a permanent change, there is this loadkeys made into rc.local thing I mentioned, but I don't understand it yet.
 
Old 01-24-2010, 09:16 PM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Original Poster
Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
I still don't quite get it, and also I don't want the ESC key to become caps lock. I don't want any caps lock key whatsoever.
 
Old 01-24-2010, 09:30 PM   #6
White Tea Citrus
LQ Newbie
 
Registered: Sep 2009
Location: Slovakia
Distribution: Trisquel 5.0 Dagda
Posts: 27

Rep: Reputation: 0
For getting it there is man.

man man
 
Old 06-03-2010, 04:52 PM   #7
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 249

Rep: Reputation: 31
Basically, there are some keymap files (to find them try "find / -name defkeymap.map") that specify what keys do what. Each key is identified by a number (I think Caps Lock is 58) and each line specifies the mapping between the key numbers and their use. A line like "keycode 58 = Escape" should do what you want. I would copy defkeymap.map to another file, and edit the "keycode 58" line as specified. Then run "loadkeys <updated file>". see man keymaps, man loadkeys, man showkey, and man dumpkeys. (I just did this myself about five minutes ago.)
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Caps-lock key as additional Control key. snr8fl3 Linux - General 1 11-25-2008 06:49 PM
How can I map the control key to the caps lock key in Linux? tate1615 Linux - General 4 07-14-2008 02:20 PM
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 11:24 PM.

Main Menu
Advertisement
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