|
From: | Archimedes Gaviola |
Subject: | Re: Ncurses keypad is not properly working in FreeBSD |
Date: | Thu, 26 Jan 2023 16:35:29 +0800 |
On Tue, Jan 24, 2023 at 4:59 PM Thomas Dickey <dickey@his.com> wrote:On Tue, Jan 24, 2023 at 12:09:08PM +0800, Archimedes Gaviola wrote:
> Hi,
>
> I have a C program that accepts and displays numeric characters in 0-9 only
> and with alphabet keys, function keys are expected not to respond to any
> code from the keyboard using keypad(). I simulated a plain Ncurses C
> program without a window and another one with a window using the newwin()
> function. The program without window works getting no response from
> alphabet keys as well as function keys, however the Enter/return key (ch ==
> KEY_ENTER) is not working instead I use (ch == '\n') to get it to work. The
Hi Thomas,The usual point of confusion for KEY_ENTER is that terminal descriptions
use the escape sequence from the numeric-keypad (active when keypad() is
called), rather than the "Enter" key on the main keyboard.
The numeric keypad in xterm (like vt100, etc), sends escape sequences
when keypad-mode is enabled. xterm changes those to the "face codes",
e.g., 0, 1, 2, etc., when NumLock is pressed. Those escape sequences
are documented in the xterm control sequences.Okay let me check that document.
Some other terminals (for which of course no documentation exists)
use different escape sequences (determined by the X keyboard configuration),
e.g., cursor-keys, page up/down, etc.
[Prev in Thread] | Current Thread | [Next in Thread] |