[comp.sys.sgi] CAPS LOCK <==> CONTROL hack?

chrisa@beldar.ma30.bull.com (Chris Anderson) (10/16/90)

Being a user of several computers, all of which have their CONTROL key
where the Iris puts its CAPSLOCK and vice versa, I would be most
grateful to discover a hack for my user.ps (or whatever) which would
permit them to be exchanged.

For that matter, swapping ESC and ~` wouldn't be a bad idea either.

Does such a thing exist? Could someone reveal the Magic Incantation
that will untangle my fingers?

Regards,

Chris Anderson		chrisa@beldar.ma30.bull.com

jim@baroque.Stanford.EDU (James Helman) (10/17/90)

   Being a user of several computers, all of which have their CONTROL key
   where the Iris puts its CAPSLOCK and vice versa, I would be most
   grateful to discover a hack for my user.ps (or whatever) which would
   permit them to be exchanged.

I don't know about NeWS, but under X, just about any keyboard
reconfiguration you want can be done with xmodmap.  "xmodmap -pk"
prints out the full keyboard table.  See xmodmap(1) for more details.

Here are some possibilities

    # clear the lock keys
    xmodmap -e 'clear lock'

    # make caps lock another control key
    xmodmap -e 'add control = Caps_Lock'

    # change backspace key to send delete/backspace
    xmodmap -e 'keycode 66 = Delete BackSpace'

    #change `/~ key to send  escape/~
    xmodmap -e 'keycode 60 = Escape asciitilde'

    #change <esc> key to send `/~
    xmodmap -e 'keycode 12 = grave asciitilde'

Jim Helman
Department of Applied Physics			Durand 012
Stanford University				FAX: (415) 725-3377
(jim@KAOS.stanford.edu) 			Work: (415) 723-9127

ken@msc.EDU (Ken Chin-Purcell) (10/17/90)

Chris Anderson writes:
|> Could someone reveal the Magic Incantation...

/replacekeys { % origkeyvals_array changedkeyvals_array -> -
        {
                /changedvals exch def
                /origvals exch def
                /keysdict origvals length dict def
                keysdict begin
                        0 1 origvals length 1 sub {
                                dup origvals exch get changedvals
                                3 2 roll get def
                        } for
                end
                createevent dup begin
                        /Name origvals def
                        /Priority 2 def
                        /Exclusivity true def
                end
                expressinterest
                {
                        awaitevent dup dup begin
                        /Name get keysdict exch get /Name exch def
                        end
                        redistributeevent
                } loop
        } fork pop pop pop
} def

% lcap	    ctrl
[ 28420 ] [ 28419 ] replacekeys


--
--  Ken