From: len
Subject: newbie Linux & Emacs
Date: 
Message-ID: <1143297592.440444.297500@i39g2000cwa.googlegroups.com>
I am trying to change the keymapping for the control key and caps lock.
 I have successfully accomplished this through xmodmap in my gui
environment.  I would like to do the same in the command line
environment.  I have read the man pages in xmodmap and have found the
lines of code.  I do not know where to put the code.  I am trying to
learn Linux/Unix and Emacs.

Also because I have a dual boot system I would like to make the same
key swap in my windows XP because I have also loaded Emacs there also.

Len

From: Deon Garrett
Subject: Re: newbie Linux & Emacs
Date: 
Message-ID: <877j6fkrrj.fsf@clapton.csm.astate.edu>
"len" <······@comcast.net> writes:

> I am trying to change the keymapping for the control key and caps lock.
>  I have successfully accomplished this through xmodmap in my gui
> environment.  I would like to do the same in the command line
> environment.  I have read the man pages in xmodmap and have found the
> lines of code.  I do not know where to put the code.  I am trying to
> learn Linux/Unix and Emacs.

The location may differ between distributions, but check for a file named
something like /usr/share/keymaps/i386/qwerty/us.map.gz.  I'm assuming
you're using the US keymap -- change as necessary.  You should be able to
use the "showkey" command to figure out the keycodes involved and swap
their definitions in the keymap file.  Use "loadkeys" to test your changes
without rebooting.

> Also because I have a dual boot system I would like to make the same
> key swap in my windows XP because I have also loaded Emacs there also.

You can find instructions online how to do this in windows.  If you trust
me enough to blindly apply a registry hack (insert evil laugh), paste the
lines below into a file named "foo.reg" and double click the file to
insert the registry changes.

------ begin cut here ------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
------ end cut here ------

Or, microsoft has a set of "resource kit tools" for Windows Server 2003 that
includes a graphical interface to remapping keys that runs fine on XP.
Google for "microsoft resource kit tools".

Note that all these suggestions are independent of Emacs, like xmodmap.
Also, I believe the windows solutions are independent of the logged in
user, so if you share the computer with others, their caps lock key "won't
work".

-- 
Deon Garrett
Institute for Intelligent Systems
The University of Memphis
·········@gmail.com
From: Rob Thorpe
Subject: Re: newbie Linux & Emacs
Date: 
Message-ID: <1143535521.172667.192060@e56g2000cwe.googlegroups.com>
len wrote:
> I am trying to change the keymapping for the control key and caps lock.
>  I have successfully accomplished this through xmodmap in my gui
> environment.  I would like to do the same in the command line
> environment.  I have read the man pages in xmodmap and have found the
> lines of code.  I do not know where to put the code.  I am trying to
> learn Linux/Unix and Emacs.
>
> Also because I have a dual boot system I would like to make the same
> key swap in my windows XP because I have also loaded Emacs there also.

You may want to post this question also to comp.emacs and
gnu.emacs.help.
From: M Jared Finder
Subject: Re: newbie Linux & Emacs
Date: 
Message-ID: <uOadnb8A_rP_2rfZ4p2dnA@speakeasy.net>
len wrote:
> I am trying to change the keymapping for the control key and caps lock.
>  I have successfully accomplished this through xmodmap in my gui
> environment.  I would like to do the same in the command line
> environment.  I have read the man pages in xmodmap and have found the
> lines of code.  I do not know where to put the code.  I am trying to
> learn Linux/Unix and Emacs.
> 
> Also because I have a dual boot system I would like to make the same
> key swap in my windows XP because I have also loaded Emacs there also.

Look for a file <~/.xsession>.  That file is executed when you start up 
X.  Mine contains stuff like this:

# Display configuration
setxkbmap dvorak
xrandr -s 1024x768
xsetroot -cursor_name left_ptr
xsetroot -solid "#000000"

# START UP PROGRAMS
gnubiff --noconfigure &
workrave &
emacs &

   -- MJF