Subject: =?ISO-8859-1?Q?Curses_getch()?=
To: None <netbsd-help@netbsd.org>
From: Zafer Aydogan <zafer@gmx.org>
List: netbsd-help
Date: 08/17/2005 06:19:08
Hello List,

I'm using a program, which uses curses function getch() with keypad()enabled
to read the Function Keys and Home End PageUp PageDown and the Arrow Keys.

Quoting from the manual on curses:

     int getch ( void );
          Get a character from stdscr. May be used with mini-
          curses.  The following function keys might be returned
          by the getch() function if keypad() has been enabled:

          KEY_DOWN  Down arrow key
          KEY_UP    Up arrow key
          KEY_LEFT  Left arrow key
          KEY_RIGHT Right arrow key
          KEY_HOME  Home key 

While the Arrow Keys are working the Keypad (Home End PageUp PageDown) ares
not, because the Escape Sequences generated seem to be wrong.

This is generated on NetBSD:

Insert: ^[[2
Delete: ^[[3
Home: ^[[7
End: ^[[8
PgUp: ^[[5
PgDown: ^[[6

compared to FreeBSD, where the Program works fine.

Insert: ^[[L
Delete: ^[[?
Home: ^[[H
End: ^[[F
PgUp: ^[[I
PgDown: ^[[G

May rely on TERMCAP and TERM settings.
Any Ideas to solve the Problem ?

Z.