Subject: Re: =?ISO-8859-1?Q?Curses_getch()?=
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-help
Date: 08/17/2005 12:25:54
In article <25285.1124252348@www49.gmx.net>,
Zafer Aydogan <zafer@gmx.org> wrote:
>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 ?

Compare the termcap entries for you terminal between NetBSD and FreeBSD.
Maybe it needs an escape sequence to enter and exit "application mode"?

christos