bug-ncurses
[Top][All Lists]
Advanced

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

Re: Ncurses keypad is not properly working in FreeBSD


From: Thomas Dickey
Subject: Re: Ncurses keypad is not properly working in FreeBSD
Date: Thu, 26 Jan 2023 20:26:32 -0500 (EST)

----- Original Message -----
| From: "Archimedes Gaviola" <archimedes.gaviola@gmail.com>
| To: "Thomas Dickey" <dickey@his.com>
| Cc: "Ncurses Mailing List" <bug-ncurses@gnu.org>
| Sent: Thursday, January 26, 2023 3:56:34 AM
| Subject: Re: Ncurses keypad is not properly working in FreeBSD

| On Thu, Jan 26, 2023 at 4:35 PM Archimedes Gaviola <
| archimedes.gaviola@gmail.com> wrote:
| 
|>
|>
|> On Wed, Jan 25, 2023 at 1:02 PM Archimedes Gaviola <
|> archimedes.gaviola@gmail.com> wrote:
|>
|>>
|>>
|>> 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.
|>>>
|>>>
|>
|> Hi Thomas,
|>
|> Okay I found this document https://www.xfree86.org/current/ctlseqs.html
|> (Xterm Control Sequences) and basically in the PC-Style Function Keys
|> section here
|> https://www.xfree86.org/current/ctlseqs.html#PC-Style%20Function%20Keys
|> the keycodes that appear in my program (with window) are exactly the same
|> as described, so below mappings are experienced when each corresponding key
|> is pressed.
|>
|> F5 - 15
|> F6 - 17
|> F7 - 18
|> F8 - 19
|> F9 - 20
|> F10 - 21
|> F11 - 23
|> F12 - 24
|>
|> Insert - 2
|> Delete - 3
|> Page Up - 5
|> Page Down - 6
|>
|> Do you think this is just a matter of tweaks somewhere in the code or
|> terminal console configuration? Any hint?
|>
|> Thanks and best regards,
|> Archimedes
|>
| 
| Oh, I'm sorry I didn't notice, you're one of the key people who did the
| revision of this document.

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net



reply via email to

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