This script is for people who wish to connect from a Linux or Unix computer to a VMS computer using telnet and get a good VT100 or VT220 emulation. The key mappings have been specifically designed to emulate the VT terminal auxiliary numeric keypad, so that you can use VMS EDT and TPU editors, as well as the many VMS applications use keys PF1 to PF4. The script should work with any recent version of Xterm using a standard extended IBM PC keyboard or a Sun keyboard.
About the keymappings. First the auxiliary numeric keypad. My prime objective with these mappings was to produce a setup that I could use with the EDT and TPU editors which make extensive use of the numeric keypad. The top row of keys PC numeric keypad (Num Lock, Divide, Multiply, Subtract) are where you find PF1, PF2, PF3, PF4 on a VT keyboard, so I have mapped them to PF1 thru PF4. The PC numeric keypad Add key (+) takes up the space of two keys which are Minus and Comma on the VT keyboard - I have mapped it to Comma (Delete Character in the EDT editor). I have then used the PC Pause key to map to VT key Minus (Delete Word in the EDT editor). The remaining keys on the auxiliary numeric keypad are the same for PC and VT.
The six keys between the main and numeric keypads on the PC (Insert, Home, Page Up, Delete End, Page Down) are usually mapped to the VT keys by either position or by (approximate) function. As I rarely use these keys I have mapped them by function as follows: PC key Insert to VT Insert Here, PC Home to VT Find, PC Page Up to VT Prev, PC Delete to VT Remove, PC End to VT Select, PC Page Down to VT Next.
Function keys. There are 12 function keys on the PC keyboard and 20 on the VT keyboard, so I map PC F1 thru F12 to VT F1 thru F12 (except for F1 thru F5 as ** below) and PC Shift F1 thru Shift F10 to VT F11 thru F20. ** The VT keys F1 thru F5 are local hardware function keys so there is nothing to emulate, however some PC to VT emulations in the past have mapped PF1 thru PF4 here, so I have done that too, even though they are already mapped on the auxiliary numeric keypad.
Xterm functionality. You lose some xterm functions when you remap the keyboard, however this script implements a scroll back buffer of 1000 lines which you scroll through using Shift and Up (a.k.a. Up Arrow or Cursor Up key) or Shift and Down.
There many different opinions on how a PC keyboard should be mapped to a VMS one - this is mine. Some VT keys are intentionally mapped twice because it seemed useful or logical to me. Please feel free to modify this script to suit yourself. I recommend the Xterm faq, the Xterm man pages, the VT220 Pro- grammer Pocket Guide and the VT220 Programmer's Reference Manual.
PC Key maps to VT Key.
------ ------
F1 PF1
F2 PF2
F3 PF3
F4 PF4
F5 unused
F6 F6
F7 F7
F8 F8
F9 F9
F10 F10
F11 F11
F12 F12
Shift F1 F11
Shift F2 F12
Shift F3 F13
Shift F4 F14
Shift F5 F15 (Help)
Shift F6 F16 (Do)
Shift F7 F17
Shift F8 F18
Shift F9 F19
Shift F10 F20
Shift F11 F11
Shift F12 F12
Print Help (F15)
Cancel Do (F16)
Pause Keypad Minus
Insert Insert Here
Delete Remove
Home Find
End Select
Prior Prev
Next Next
BackSpace BackSpace (sends DEL - ascii 127)
Num_Lock PF1
KP_Divide PF2
KP_Multiply PF3
KP_Subtract PF4
KP_Add Keypad Comma
KP_Enter Enter
KP_Decimal Period
KP_0 Keypad 0
KP_1 Keypad 1
KP_2 Keypad 2
KP_3 Keypad 3
KP_4 Keypad 4
KP_5 Keypad 5
KP_6 Keypad 6
KP_7 Keypad 7
KP_8 Keypad 8
KP_9 Keypad 9
Up Up
Shift Up Scroll Back
Down Down
Shift Down Scroll Forward
Right Right
Left Left
Erik Ahlefeldt - [email protected] May 2000.