Subject: Curses and function-keys
To: None <netbsd-users@netbsd.org>
From: =?ISO-8859-1?Q?Mikael_Nystr=F6m?= <miny3945@comhem.se>
List: netbsd-users
Date: 01/02/2006 10:03:07
Hi,
I'm currently writing a application that uses the curses and form 
libraries, and have some problems with function keys.

According to the manual page, one has to activate keypad(WINDOW *, TRUE) 
to be able to map function keys. It seems like the curses libraries 
depends on /usr/share/misc/termcap, and that not all function keys are 
defined(?). I'm using keypad() but still have to use define_key() to 
be able to detect for example KEY_F(*) and arrow keys. I'm 
using NetBSD 3.0/XFree86 4.5.0 and have tested xterm, mrxvt and vt220.

How do I detect function keys correctly, and how should I do to make my 
code work with different terminals? It's my first curses-based 
application and I'm no terminal guru, so I believe that I'm missing 
something vital... :-)

Please cc me because I'm not on the list.

/Mikael