Path: utzoo!utgpu!water!watmath!clyde!att-cb!ihnp4!ptsfa!ames!ll-xn!oberon!pollux.usc.edu!xwu From: xwu@pollux.usc.edu (Xinhua Wu) Newsgroups: comp.unix.questions Subject: a question about using curses lib Message-ID: <7078@oberon.USC.EDU> Date: 19 Feb 88 20:56:06 GMT Sender: news@oberon.USC.EDU Reply-To: xwu@pollux.usc.edu (Xinhua Wu) Organization: University of Southern California, Los Angeles, CA Lines: 19 I'm writing a program using curses lib. I want to use function keys (eg, use arrow keys to choose from a menu). The program should work for different terminal types (vt100, xterm, ibmaed, h19, etc). My general question is: how can I make the program recognize a function key immediately after the user hits it? I'm now using wgetch(win) to read the input (wgetstr(win, str) needs a newline or EOF). The problem is that in this case the program needs to know in advance the code for a function key and how long the code is. Since the code and the length vary for different terminal types (eg, the code for uparrow is \033A for ibmaed, \033[A for xterm and vt100 under X), the program may not work for new terminal types. Thanks in advance for any help. Xinhua Wu xwu@cse.usc.edu