Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!think!linus!linus!mwunix.mitre.org!jcmorris From: jcmorris@mwunix.mitre.org (Joe Morris) Newsgroups: comp.sys.ibm.pc.hardware Subject: Re: VT220 Function Keys Message-ID: <115099@linus.mitre.org> Date: 28 Jul 90 17:32:09 GMT References: <2470@hq.af.mil> <474@wicat.UUCP> et al Sender: usenet@linus.mitre.org Reply-To: jcmorris@mwunix.mitre.org (Joe Morris) Distribution: na Organization: The Mitre Corporation Lines: 51 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 or 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: [ ~ (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 [ 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.