'286 curses keypad() mode

Johnie Wardlaw wardlaw at kaos.UUCP
Thu May 23 05:14:14 AEST 1991


I am having a problem using the function key capabilities in curses on
SCO Xenix V/286 v2.3.2.  I am trying to add arrow key support to an
application using the keypad() function in the curses library and it
appears to be ignoring the fact that I am enabling this.  I have tried
using both the -DM_TERMCAMP and -DM_TERMINFO as well as linking with
the termcap and terminfo libraries.  Nothing seems to work.  Has anyone
else had this problem?  Is there a fix available?

Following is the test program I have written to demonstrate the problem.
Instead of seeing a 16-bit key code for the arrow keys, I am seeing the
escape sequence the key is sending.  I have tried this on the console
and a Wyse 50 terminal connected to my tty2a serial port.

-- Start of test program ktest.c --

/*
** To compile: cc -DM_TERMCAP -DSYSVR2 ktest.c -lcurses -ltermcap -o ktest
*/

#include <curses.h>

main()
{
	int	ch;

	initscr();
	crmode();
	noecho();
	keypad(stdscr,TRUE);
	do {
		ch = getch();
		if (ch == 27)
			printf("<ESC>");
		else if (ch <= 31 || ch >= 127)
			printf("0x%04x",ch);
		else
			printf("%c",ch);
	} while (ch != 4);
	endwin();
}

-- End of test program ktest.c --

This test program works fine on the SCO Xenix V/386 v2.3.2GT machine I have
access to.  I've been wanting to add arrow key support to my applications
for quite some time now and I'm stuck with this bug.

Thanks in advance!

-- Johnie Wardlaw
/----------------------------------------------------------------------------\
|    Johnie Wardlaw, Senior Partner/Programmer, Alchemy Software Designs     |
|----------------------------------------------------------------------------|
| Internet |      wardlaw at kaos.UUCP       | "Wow.  It's like you're reading  |
|   UUCP   | ...ucsd!ucrmath!kaos!wardlaw |  my mind, man!" -- Bart Simpson  |
\----------------------------------------------------------------------------/



More information about the Comp.unix.xenix.sco mailing list