How to remap keys cntr <--> caps?

How to remap keys cntr <--> caps?

Post by Koehle » Fri, 08 Oct 1999 04:00:00




Subject: How to swap cntr caps keys?
Newsgroups: comp.unix.solaris
Organization:
Summary:
Keywords:

Hi

How can I remap my keyborad to swap the control and
caps lock keys? And while I'm at it, I'd like to move
(or at least duplicate) the escape key so that it's
mapped to the first key to the left of my function
key set (f1, f2...f12) at the top of my keyboard.

I'm new to solaris (7) and the CDE environment and
the keyboard I got is driving me crazy! In vi, I'm
continuously hitting the wrong keys; I'm not going
to bother learning this new (improved?) key layout
as I still do a lot of stuff (even vi stuff) on PCs.

I looked at the man pages for dumpkeys and saw some
stuff on the web (CDE FAQ) but am not sure (scared)
how best remap keys.

Any help / pointers would be most apreciated.
Thanx
   -Ryan

Ryan Koehler

 
 
 

How to remap keys cntr <--> caps?

Post by jfie.. » Fri, 08 Oct 1999 04:00:00




Quote:> How can I remap my keyborad to swap the control and
> caps lock keys?

Lucky for you, X makes the keyboard completely reconfigurable (well,
except for some windows and mac X servers won't let you do some
things).  To swap caps and contorl, put something like this in a file:

remove Lock = Caps_Lock
remove Control = Control_L
keycode 65 = Caps_Lock
keycode 37 = Control_L
add Lock = Caps_Lock
add Control = Control_L

But check on the keycodes using xev (in /usr/openwin/demo of all
unlikely places).  Then feed this file to xmodmap.  Lets see....looks
like I'm currently doing it in ~/.dtprofile with:

if [ -f $HOME/.xmodmap-`uname -m` ]; then
        xmodmap $HOME/.xmodmap-`uname -m`
fi

I have the uname in there because the sun machines need different
treatment than the peecee machines.  Alternatively, you could select
based on $DISPLAY, or grepping something returned by xdpyinfo.  I've
used those approaches too.  If you only use one type of keyboard,
then don't worry!

And whose idea was it anyway to put such a useless key (caps lock) in
such a useful place?

Quote:> And while I'm at it, I'd like to move
> (or at least duplicate) the escape key so that it's
> mapped to the first key to the left of my function
> key set (f1, f2...f12) at the top of my keyboard.

Xmodmap again.  Study the manual page and play with xev which shows
you the*details of what each key is generating.  Just add the
appropriate mappings to the file you do the swapping in.  Some other
stuff I have for x86 solaris:

! make shift-space make an underscore
keysym space = space underscore

! make Control_R a compose key
remove Control = Control_R
keysym Control_R = Multi_key

! make F11 and F12 behave as F11 and F12
keysym SunF36 = F11
keysym SunF37 = F12

-john

 
 
 

How to remap keys cntr <--> caps?

Post by Rich Tee » Fri, 08 Oct 1999 04:00:00



Quote:> I'm new to solaris (7) and the CDE environment and
> the keyboard I got is driving me crazy! In vi, I'm
> continuously hitting the wrong keys; I'm not going
> to bother learning this new (improved?) key layout

New?!  Hah, having control to the left of "A" is the
original place; it's peecees that've got *ed up
key placements!

I think this is the first post I've ever seen wanting
to map the keys from the "correct" one to the peecee
one (I've seen loads that are the reverse).

--
Rich Teer

NT tries to do almost everything UNIX does, but fails - miserably.

The use of Windoze cripples the mind; its use should, therefore, be
regarded as a criminal offence.  (With apologies to Edsger W. Dijkstra)

If it ain't analogue, it ain't music.

Voice: +1 (250) 763-6205
WWW: www.rite-group.com

 
 
 

1. <Alt>+<key> = <Esc><key> ?

Hi,

How should I tell Xserver to treat simultaneous press (in editor) on
<Alt>+<E> as <Esc><E>, like under VC. Now it returns A with circle on
top.
Therefore, I want the same behaviour of Alt_L under X and console.

Best regards.

                Zlatko
______________________________________________________________________________

Dr. Zlatko Rek                          |     Phone: +386 61 1771 200
Faculty of Mechanical Engineering       |            +386 61 1771 150
Lab. for Fluid Dynamics and Thermodyn.  |       Fax: +386 61 218 567
Askerceva 6                             |    E-mail:

SI-1000 Ljubljana, SLOVENIA             |       WWW:
http://www2.ijs.si/~rek
______________________________________________________________________________

2. Gateway P5-90?

3. <><><> MOUNTING EXTENDED PARTITION <><><>

4. GCC and backward compatibility: Solaris 2.6 -> 2.5

5. Wanted: <><><> Unix Specialist <><><>

6. use purify to test a library

7. LILO help <><><><><><>

8. Netscape Fasttrack and PHP

9. pl12 and <Meta>-<Shift>-<Key>

10. *{<><>}*Linux*Screen*Difficulties*{<><>}*

11. << <<anyone using dyn-html?>> >>

12. (<><>)*Linux*Screen*Difficulties*(<><>)

13. Samba problem: WinXP <-> ADSL <-> Internet <-> Cable <-> Linux