Iris key remapping
Eric Pettersen%CGL
pett at cgl.ucsf.edu
Thu Jan 12 12:33:12 AEST 1989
Here is some code you can put in your user.ps to swap the CapsLock and
Control key under 3.0 and 3.1c. I suggest that you actually imbed it your
RestartActions array, just to be safe. This code uses undocumented operators
and constants, so who knows how it will work in future releases!
It is possible to change any key, but the code below is pretty much
hard-coded to do what it does, and is not a flexible facility for arbitrary
key remapping...
Eric Pettersen
pett at cgl.ucsf.edu
...!ucbvax!ucsfcgl!pett
-----
{
/CapsOn false def
/ControlOn false def
/eventhandler {
dup /Action get
exch /Name get
{
28420 { % Caps Lock
/DownTransition eq
{ /ControlOn true def }
{ /ControlOn false def } ifelse
}
28419 { % Control
/DownTransition eq
{ /CapsOn CapsOn not def } if
}
} case
2 CapsOn { /LampsOn } { /LampsOff } ifelse
keyboardcontrol
CapsOn { 1 } { -1 } ifelse 4
adjustkeyboardshiftstate
ControlOn { 1 } { -1 } ifelse 1
adjustkeyboardshiftstate
} def
createevent dup begin
/Name [ 28420 28419 ] def
end
expressinterest
{
awaitevent eventhandler
} loop
} fork pop
-----
More information about the Comp.sys.sgi
mailing list