[comp.sys.ibm.pc.hardware] VT220 Function Keys

dan@hq.af.mil (Dan..Jezek) (07/25/90)

Does anyone know the escape sequence for the F8 Function key for 
a VT220.  Please don't reply with the VT52 or VT100 sequences, they 
are not the same.  Thats the F8 key, if anyone happens to know it
or knows where I might find it please respond.
[ Alert DEC guru's ]

Thanks in advance...

drack@titan.tsd.arlut.utexas.edu (Dave Rackley) (07/26/90)

In article <2470@hq.af.mil> dan@hq.af.mil (Dan..Jezek) writes:

>   Does anyone know the escape sequence for the F8 Function key for 
>   a VT220.  Please don't reply with the VT52 or VT100 sequences, they 
>   are not the same.  Thats the F8 key, if anyone happens to know it
>   or knows where I might find it please respond.
  

The following sequence will do it:

                ESC [ 1 9 ~


The spaces between characters are for clarity only.  A complete listing may
be found in Appendix D:  VT320 Programming Summary, Installing and Using the
VT320 Video Terminal.  VT220 shares the same sequences.

--
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| David Rackley		        |"The described functionality performed       |
| Applied Research Laboratories | flawlessly, unfortunately we had absolutely |
| P.O. Box 8029                 | no use for it in this system."              |
| Austin, TX.  78713-8029       |                    -- AS*S user, Dec. 1989  |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
|        DISCLAIMER?  I don't know anything 'bout any ol' disclaimer!         |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+

rick@wicat.UUCP (Rick Moll) (07/28/90)

drack@titan.tsd.arlut.utexas.edu (Dave Rackley) writes:

>In article <2470@hq.af.mil> dan@hq.af.mil (Dan..Jezek) writes:
>>   Does anyone know the escape sequence for the F8 Function key for 
>>   a VT220.

>The following sequence will do it:
>                ESC [ 1 9 ~

Note that depending on your terminal setup, an eight-bit CSI
character may be generated in place of the "ESC [".

If eight-bit control sequences are disabled, however, aren't the
exact same codes produced by VT100's and VT220's?  I don't remember
ever writing special case code for the different terminals.

--Rick Moll
rick@wicat.com

jcmorris@mwunix.mitre.org (Joe Morris) (07/29/90)

In article <474@wicat.UUCP> rick@wicat.UUCP (Rick Moll) writes:
>drack@titan.tsd.arlut.utexas.edu (Dave Rackley) writes:
>
>>In article <2470@hq.af.mil> dan@hq.af.mil (Dan..Jezek) writes:
>>>   Does anyone know the escape sequence for the F8 Function key for 
>>>   a VT220.
>
>>The following sequence will do it:
>>                ESC [ 1 9 ~
>
>Note that depending on your terminal setup, an eight-bit CSI
>character may be generated in place of the "ESC [".
>
>If eight-bit control sequences are disabled, however, aren't the
>exact same codes produced by VT100's and VT220's?  I don't remember
>ever writing special case code for the different terminals.

The VT-220 generates standard VT-100 sequences for the keypad and the 
cursor controls, using either <CSI> or <SS3> prefixes as directed by
the host-generated setup orders, and using either 7-bit or 8-bit
sequences based on the terminal setup.  As long as you're using 7-bit
mode in the terminal the generated sequences are identical.

The difference is in the keys which were introduced on the VT-200 but
don't exist on a VT-100.  This includes all of the keys along the top
row and the six editing keys above the cursor pad.  All of these new
keys send the sequence:

    <ESC> [ <n> ~

(that's ESCAPE, left bracket, one or two decimal digits, tilde)

The six editing keys send single digits 1 through 6:

   Find   Insert   Remove        1  2  3
  Select   Prev     Next         4  5  6

(Note the nice pattern which matches the keytops on the keyboard.)

The function keys along the top row (F6 through F20; the first five 
numbers are "assigned" to the terminal control buttons on the left) send
two-digit numbers 17 through 34.  The numbers skip a position where there
is a gap between keytops (strange, but that's DEC's way of designing it),
so F6-F10 use 17-21; F11-F14 use 23-26; HELP and DO are 28 and 29, and
F17-F20 are 31-34.  As noted by Dave Rackley, this makes the string
emitted for F8 to be <ESC> [ 19 ~

Remember that the edit keys and all of the top row keys except F11-12-13
are dead and send nothing if the terminal is in VT-100 mode.  In this
case these three keys send ESC, BS, and LF respectively since there are
no other keys on the keyboard for this purpose.