Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!unicorn!ogicse!cvedc!nosun!qiclab!m2xenix!quagga!ucthpx!oct1!olsa99!tabbs!wiggles!theo From: theo@wiggles.UUCP (T. Kramer) Newsgroups: comp.unix.wizards Subject: Escape key and curses. Keywords: RS/6000, curses, ESCAPE Message-ID: <1343@wiggles.UUCP> Date: 25 Jun 90 06:43:08 GMT Sender: uucp@ucthpx (UCT Mail Administration) Reply-To: theo@wiggles.UUCP (T. Kramer) Organization: Wiggles Inc. Lines: 34 #include I have been having problems trying to trap a single Escape character in a couple of implementations of UNIX ie. AIX on the IBM RS/6000 and UNIX V2 on the ICL Clan 500 machine. Below follows a test program that will print out a message for every key pressed. However, the Escape character does not come through when pressed the first time for the above systems. I am using a freedom 100 terminal on the ICL Clan 500 and an IBM3151 terminal on the RS/6000. I know that it is possible to trap a single Escape character in both these implementations... it works in vi! void main() { int key; initscr(); nonl(); noecho(); cbreak(); keypad(stdscr,1); key = getch(); while(key != 'Q' && key != 'q') { addstr("Key pressed = "); addch(key); addch('\n'); refresh(); key = getch(); } endwin(); } Does anyone out there have any suggestions?