SUMMARY: getting vt100 keypad on sun4 keyboard in xterm

From: Jeffrey Youngstrom (jeffy@teda.Teradyne.COM)
Date: Wed Feb 26 1992 - 16:33:57 CST


Heya,

        A couple of weeks ago I asked how one goes about getting the
        sun4 keypad to put out the escape sequences for the vt100 keys
        (like PF1 and its ilk)

        I got lots of responses, and thanks to everyone who made
        suggestions.

        There were several suggestions that indicated xmodmap.
        Unfortunately, I didn't want to remap the keyboard for all
        windows, only for a couple that were unfortunate enough to have
        to access a VAX.

        The solution I settled on uses the translation resource in
        xterm. Here's what you do:

1) add the following lines to your .Xdefaults file (note that the first
   character of each of these `string' commands is an ESC (^[), so if it
   got nuked in transit, this won't work. I'll put a uuencoded version of
   this at the bottom of this message just in case.):

----cut here----
XTerm*vt100.translations: #override \
   !Shift <Key>R1: keymap(vt100)
XTerm*vt100Keymap.translations: #override \
   <Key>R4: string("OP")\n\
   <Key>R5: string("OQ")\n\
   <Key>R6: string("OR")\n\
   <Key>KP_Subtract: string("OS")\n\
   Shift<Key>KP_2: string("B")\n\
   Shift<Key>KP_4: string("D")\n\
   Shift<Key>KP_6: string("C")\n\
   Shift<Key>KP_8: string("A")\n\
   <Key>KP_0: string("Op")\n\
   <Key>KP_1: string("Oq")\n\
   <Key>KP_2: string("Or")\n\
   <Key>KP_3: string("Os")\n\
   <Key>KP_4: string("Ot")\n\
   <Key>KP_5: string("Ou")\n\
   <Key>KP_6: string("Ov")\n\
   <Key>KP_7: string("Ow")\n\
   <Key>KP_8: string("Ox")\n\
   <Key>KP_9: string("Oy")\n\
   <Key>KP_Decimal: string("On")\n\
   <Key>KP_Add: string("Ol")\n\
   <Key>R2: string("Om")\n\
   <Key>KP_Enter: string("OM")\n\
   !Shift <Key>R1: keymap(None)
----cut here----

2) use xrdb to get the window manager to notice that something was
   changed

xrdb ~/.Xdefaults

3) start up an xterm.

Once the xterm starts up, if you type Shift-R1, it turns on the vt100
keymap which remaps the type 4 keypad to look like this:

+---------------------------+
| | |Scroll| Num |
|Pause | , |Lock/ | Lock |
| | |Break | |
|------+------+------+------|
| | | | |
| PF1 | PF2 | PF3 | PF4 |
| | | | |
|------+------+------+------|
| | | | |
| 7 | 8 | 9 | |
| | | | |
|------+------+------+ - |
| | | | |
| 4 | 5 | 6 | |
| | | | |
|------+------+------+------|
| | | | |
| 1 | 2 | 3 | E |
| | | | n |
|------+------+------+ t |
| | | e |
| 0 | . | r |
| | | |
+---------------------------+

When shifted, 8, 4, 6, and 2 return the usual cursor motion codes.

Note that only the current xterm is affected. If you start up a new
one, it will come up with the original keys and you'll have to press
Shift-R1 to get it to use the vt100 bindings.

Pressing Shift-R1 again returns the normal keypad.

If anyone wants a copy of all the mail I got, send me email.

Thanks again to everyone who offered suggestions.

jeffy

--
Jeffrey Youngstrom   jeffy@eda.teradyne.com or ...!{decwrl,sun}!teda!jeffy
Teradyne EDA  West  |  5155 Old Ironsides Drive  |  Santa Clara, CA  95054
                I have no idea what I'm doing out of bed.

Here's that xdefaults stuff uuencoded. ---snip and save---- begin 666 vt100keys M6%1E<FTJ=G0Q,# N=')A;G-L871I;VYS.B )(V]V97)R:61E(%P*(" @(5-H M:69T(#Q+97D^4C$Z"0EK97EM87 H=G0Q,# I"EA497)M*G9T,3 P2V5Y;6%P M+G1R86YS;&%T:6]N<SH)(V]V97)R:61E(%P*(" @/$ME>3Y2-#H)"0D)<W1R M:6YG*"(;3U B*5QN7 H@(" \2V5Y/E(U.@D)"0ES=')I;F<H(AM/42(I7&Y< M"B @(#Q+97D^4C8Z"0D)"7-T<FEN9R@B&T]2(BE<;EP*(" @/$ME>3Y+4%]3 M=6)T<F%C=#H)<W1R:6YG*"(;3U,B*5QN7 H@("!3:&EF=#Q+97D^2U!?,CH) M"7-T<FEN9R@B&T(B*5QN7 H@("!3:&EF=#Q+97D^2U!?-#H)"7-T<FEN9R@B M&T0B*5QN7 H@("!3:&EF=#Q+97D^2U!?-CH)"7-T<FEN9R@B&T,B*5QN7 H@ M("!3:&EF=#Q+97D^2U!?.#H)"7-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