[comp.unix.aix] curses attr*

slh@gibdo.engr.washington.edu (04/23/91)

	Has any one used curses and specifically the attr*() attribute
	functions and the KEY_* code from getch()?
	Using attron with anything but A_STANDOUT screws up cursor
	position and doesn't produce the desired/expected effect.
	The KEY_*'s codes never get returned from getch(),
	even with keypad(stdscr,TRUE) set.
	I either get nothing or at most what look like it might be
	the char from the escape code.
	I've tried almost all the KEY_* values and yes the receiving
	variable is defined as an int.
	I tried these things on the console, in an aixterm and
	on a vt100 (emulator), and they suck everywhere.
	Do I need to do something tricky?  Do they plain not work?

	Thanks.

hbergh@nl.oracle.com (Herbert van den Bergh) (04/23/91)

In article <1991Apr23.073202.18324@gibdo.engr.washington.edu> slh@gibdo.engr.washington.edu () writes:
>
>	Has any one used curses and specifically the attr*() attribute
>	functions and the KEY_* code from getch()?
>	Using attron with anything but A_STANDOUT screws up cursor
>	position and doesn't produce the desired/expected effect.

I don't know about this one, but may be related to the next.`O

>	The KEY_*'s codes never get returned from getch(),
>	even with keypad(stdscr,TRUE) set.
>	I either get nothing or at most what look like it might be
>	the char from the escape code.

Do you mean the codes don't match the KEY_ defines or don't you get
any return value?

>	I've tried almost all the KEY_* values and yes the receiving
>	variable is defined as an int.
>	I tried these things on the console, in an aixterm and
>	on a vt100 (emulator), and they suck everywhere.
>	Do I need to do something tricky?  Do they plain not work?

I suggest you define NLS before including curses.h, because it seems
that the getch() routine returns NLS codes. The return type of getch
isn't int, but chtype, which is typedef'ed in curses.h, and different
when compiled with or without NLS defined.


>	Thanks.

No problem.
-- 
Herbert van den Bergh,		Email:	hbergh@oracle.nl, hbergh@oracle.com
ORACLE Europe
--

slh@gibdo.engr.washington.edu (04/24/91)

In article <1345@nlsun1.oracle.nl> hbergh@oracle.nl (Herbert van den Bergh) writes:
|In article <1991Apr23.073202.18324@gibdo.engr.washington.edu> slh@gibdo.engr.washington.edu () writes:
[stuff]
|I suggest you define NLS before including curses.h, because it seems
|that the getch() routine returns NLS codes. The return type of getch
|isn't int, but chtype, which is typedef'ed in curses.h, and different
|when compiled with or without NLS defined.
|
	(also suggested by Ed Spire to someone else's query)
	This worked; it got both the video attributes and KEY_* code working.
	As best I can tell from the include, the return type is int,
	although I did see the chtype stuff.
	I think it's bullshit I should have to define NLS to get this to work.
	Thanks.