Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR/AA) Newsgroups: comp.unix.programmer Subject: Re: Distinquishing escape key from arrow and function keys Message-ID: <1991Apr13.174756.7438@NCoast.ORG> Date: 13 Apr 91 17:47:56 GMT References: <4193@uakari.primate.wisc.edu> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR/AA) Followup-To: comp.unix.programmer Organization: North Coast Public Access Un*x (ncoast) Lines: 23 As quoted from <4193@uakari.primate.wisc.edu> by bin@primate.wisc.edu (Brain in Neutral): +--------------- | On a BSD system, select() does the timeout nicely. I'm not so familiar | with System V. Do you use the MIN and TIME special control character | values in the termio.c_cc[] array? What about under POSIX? +--------------- SVR3 curses will do this for you --- when you call keypad() on a window, it will return special keys as #define'd values starting at 0400. It has a timeout of about a second (this may be tuneable via halfdelay()). Some programs I use make use of VMIN and VTIME. My own programs don't do timeouts, but could fairly easily do them because they use select() anyway. (On systems that support it, at least.) My main technique for avoiding ESC anomalies is to not use bare ESC for anything and to try to map things on to keys without an ESC prefix... which is difficult on a DEC-compatible terminal. ++Brandon -- Me: Brandon S. Allbery Ham: KB8JRR/AA on 2m, 220, 440, 1200 Internet: allbery@NCoast.ORG (QRT on HF until local problems fixed) America OnLine: KB8JRR // Delphi: ALLBERY AMPR: kb8jrr.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery KB8JRR @ WA8BXN.OH