#include <stdio.h> info = _viphdr(term);
The special keys of some types of synchronous VIP terminals (e.g. Questars) transmit one or two characters in a way that does not deliver the characters on the normal input stream.
Normally, such special sequences are NOT delivered as part of the normal input stream. In other words, pressing such a key is "invisible" to the program. However, you can still retrieve such sequences by using "_viphdr". The return value of "_viphdr" is a four-character constant of the form
The first two characters 'DD' specify a destination code as given in the VIP Text Header; this is almost always two blanks ' ' indicating that the text came from the terminal screen. Other possible destination codes are described in the GRTS and NPS Reference Manuals.
The second two characters 'xy' specify the characters transmitted by the key. If only one character was transmitted by the key, the second character ('y') will be a blank. For example, if the key just transmits ESC F, the result of "_viphdr" will be
' F '
If your program intends to accept special key input, it might be better to use "_ttyio" to turn on VIP function code mode for the terminal rather than using "_viphdr". However, "_viphdr" works whether or not you are in VIP mode.
expl nsc lib _ttyio
Copyright © 1996, Thinkage Ltd.