[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escape sequences and ncurses



On Mon, 4 Sep 2000, Jay Link wrote:

> 
> Ok, I know this is super-basic, but I'm an idiot...
> 
> I'm using ncurses, and I'm checking for input with getch(), but I want to
> know when someone types something funky (like an arrow key).
> 
> How do I check to see if the value returned by getch() includes an escape
> sequence? It's an "int" value, so it oughta be simple, but I must be 
> missing something.

man curs_getch

Gives a huge number of escape sequence macros. As far as decting _any_
keyboard functions, perhaps you should do a 

if (getch() <= 127) then
	printf ("It's Normal!);

I'm too lazy to test that, but you might want to check it out.

Jordan Bettis.
"Probably the best operating system in the world is the [operating system]
 made for the PDP-11 by Bell Laboratories." - Ted Nelson, October 1977

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.