[Top][All Lists]

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

Re: Enter Key getch

From: Thomas Dickey
Subject: Re: Enter Key getch
Date: Mon, 17 Jan 2011 16:50:30 -0500 (EST)

On Mon, 17 Jan 2011, kev82_ wrote:

I am calling wgetch on a window where keypad is set to true. It is not
returning KEY_ENTER, but the ascii LF character (10dec). I found another
post where someone said that some terminals return the ASCII control code
for the key which kind of makes sense as LF is used for newline on Apple

Something like that - ncurses would return ASCII CR if nonl() is invoked.

KEY_ENTER would be used for the numeric keypad's "Enter" key, if defined.

There's a comment in lib_getch.c which claims that Solaris curses could
return any of those three (LF, CR, KEY_ENTER) depending on nonl() and echo() calls, but the comment is very old - like the logic in that module.

(I see ncurses' manpage doesn't go into that much detail - another to-do item...)

I am trying to write a portable application so I'd like to know which codes
to trap for the enter key. Would I be pretty much covered with CR, LF, and


Thomas E. Dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]