[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using the `Win' key as `Ctrl' in Emacs?
From: |
gebser |
Subject: |
Re: Using the `Win' key as `Ctrl' in Emacs? |
Date: |
Thu, 1 Jul 2004 05:12:49 -0400 (EDT) |
At 16:23 (UTC+0800) on Fri, 18 Jun 2004 Xiaoyong Jin said:
= On 18 Jun 2004 01:05:27 -0700
= rob@tenfoot.org.uk (Rob Walker) wrote:
=
= > > ....
=
= Yes, I've used xmodmap. I tried this:
=
= xmodmap -e "add control = Super_R"
=
>From "man xmodmap":
One of the more irritating differences between keyboards is the location
of the Control and Shift Lock keys. A common use of xmodmap is to swap
these two keys as follows:
!
! Swap Caps_Lock and Control_L
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
Put the above code into ~/.Xmodmap and it should be read and executed
when you log into an X session (by /etc/X11/xinit/xinitrc). This is a
good thing to do when you have an account on someone else's UNIX system.
For my own machines (e.g., at home) I simply copy
/lib/kbd/keymaps/i386/qwerty/us.map.gz to
/lib/kbd/keymaps/i386/qwerty/ctrlcaps.gz, then edit the latter to get
the same effect as the ~/.Xmodmap code (above). This requires changing
only two of its lines to these:
keycode 29 = Caps_Lock
keycode 58 = Control
(Make sure that these lines don't end with a space character; for some
reason that screws things up.)
To have ctrlcaps loaded into X (e.g., at bootup), make the appropriate
change in whatever your Linux flavor points to in its /etc/*/init.d/key*
startup script. On RedHat and similars, edit /etc/sysconfig/keyboard to
read:
KEYTABLE="ctrlcaps"
Pretty much these same steps have worked on a variety of Linux boxes as
well as HPs, Suns, and other Unices.
hth,
ken