Another Curses Question

James A. Landay landay at ardent.com
Sat Aug 12 02:27:52 AEST 1989


I am trying to use Curses to implement a simple user interface
and am having a couple of problems.

1. When I type the back-space or delete key, I get a ^H echoed
to the screen rather than a backspace operation.  My terminal
is set up correctly, because when I type backspace in vi or
the shell it works properly.  Any ideas?


2. I would like to somehow trap the TAB key so that I get '\t'
back to my program, yet without have a TAB echoed to the screen
(or only echoed as a space if anything).  
I thought I could try:

	getyx (win, oldy, oldx);
	noecho ();
	ch = getch ();
	if (ch == '\t') {
		/* do stuff */
	}
	else {
		echo ();
		move (oldy, oldx);
		addch (ch);
	}

But this didn't seem to work.

Thanks,

James

landay at ardent.com
	 or
landay at cory.berkeley.edu



More information about the Comp.unix.questions mailing list