[comp.sys.next] Solution to VT100 keypad query

JOE@oregon.uoregon.edu (Joe St Sauver) (03/24/90)

John Schneider has my eternal gratitude, and a free beer available on demand
the next time he's here in the scenic Willamette Valley. The text of his mail
message, which he asked me to post, follows below.

After trying his solution, I have only a couple of brief comments to add to 
his excellent note (everyone else may already know these things, but I had to 
figure it out the hard way):

   -- xmodmap requires the X server to be declared and active at the time
   you execute vt100-keys (which makes sense when you think about it, I guess),
   so don't auto-execute vt100-keys unless you routinely run the X server,

   and

   -- you must execute the vt100-keys command FROM THE SHELL you're going to
   launch xterm from, which also makes sense since that would allow you to 
   have different mappings for different terms launched from different shells.

Anyhow, by using John's fix, xterm does basically everything I need to survive 
telneted in to VAX/VMS systems. I even have on-screen Tektronix emulation via
xterm's -t option... 

Sign me a *THRILLED* NeXT/VMS user! 

[Now, if Borland would just port Quatro to the NeXT, you'd hear no more 
griping from me forever -- or at least for a LONG time!]

Joe St Sauver (JOE@OREGON.UOREGON.EDU or JOE@OREGON)

>From:	IN%"schneidj@nextasy2.ece.wsu.edu" 23-MAR-1990 14:35:48.85
>To:	joe@oregon.uoregon.edu
>Subj:	Keyboard patch
>
>Joe,
>
>This should solve the keyboard problems (it ain't very pretty so my
>apologies in advance):
>
>I added the following line to my .cshrc file
>
>alias vt100-keys xmodmap /Users/schneidj/.vt100-keymap
>
>(Of course /Users/schneidj should be substited with the whatever
>directory you want.)  The file /Users/schneidj/.vt100-keymap contains
>the following five lines
>
>keycode 21=KP_Separator
>keycode 38=KP_F1
>keycode 39=KP_F2
>keycode 40=KP_F3
>keycode 37=KP_F4
>
>When I am using an xterm and I am going to log-on to a VAX I type
>"vt100-keys".  This will give the appropriate keypad definitions to the
>top row of the keypad and the comma.  Note that the tilde character is
>wiped out on the keypad but it is still available through <SHIFT><ESC>
>(as it always is).  Also, the back-quote is completely gone.  Not
>being much of a unix man I rarely have occasion to use it and I don't
>suffer for the loss.  Anyone who needs this key could map it to
>something accessible.  I believe that VAXes using VMS 5.0 and above
>send out an inquiry upon log-on to determine the terminal type (a
>control sequence equivalently generated by issuing the command SET
>TERMINAL/INQUIRE).  I'm sure that someone clever could use that
>control sequence to toggle the key map, but that person is not me.
>Finally, I guess I should have a file called .xterm-keymap which I
>could use to restore the original key maps but I haven't gotten around
>to it yet (but it is a trivial thing to do).
>
>You may wanted to post this solution to the net.  I am unable to from
>my site.  Since I often make the trip down I-5 on the way to
>California, I'd like to know if there is a beer waiting for me along
>the way in Oregon.
>
>Later,
>John Schneider

chiu@amelia.nas.nasa.gov (Tsau Chiu) (03/25/90)

In article <17998@oregon.uoregon.edu> JOE@oregon.uoregon.edu (Joe St Sauver) writes:
     <info about vt100 keymap deleted>
>>I added the following line to my .cshrc file
>>
>>alias vt100-keys xmodmap /Users/schneidj/.vt100-keymap
>>
>>keycode 21=KP_Separator
>>keycode 38=KP_F1
>>keycode 39=KP_F2
>>keycode 40=KP_F3
>>keycode 37=KP_F4

To restore the keymap for NeXT keyboard, save the following five lines
into a file, say ~/.xterm-keymap.

keycode 21=KP_Add
keycode 38=quoteleft asciitilde
keycode 39=KP_Equal
keycode 40=KP_Divide
keycode 37=KP_Multiply

Then add the following to your aliases -

alias xterm-keys xmodmap ~/.xterm-keymap

When you need to restore the NeXT key mapping, just run the command,

     xterm-keys

from a shell.

-- 
--
Ing-Tsau Chiu                       chiu@amelia.nas.nasa.gov
                                    chiu@wk25.nas.nasa.gov