|
From: | Brad Hines |
Subject: | RE: Ncurses keypad is not properly working in FreeBSD |
Date: | Mon, 23 Jan 2023 23:07:19 -0800 |
I’m not sure if this is related to your question or not, but perhaps it will help. I had some issues with certain keycodes, and I recall that there’s something funny about xterm. It may be that xterm is the source of your problems. A quick and dirty thing to try would be to try a different terminal type. I made a note in my code that I found this online that had some info, might be of help to you: https://stackoverflow.com/questions/16975367/ncurses-reading-numpad-keys-and-escaping That is solving a slightly different set of keys than I was worried about. I am using CDK which is built on top of ncurses, but I ended up extending the already-defined key set with my own customer keys to define ALT-A to ALT-Z and then ALT-a to ALT-z. From: help-ncurses-bounces+brad.hines=planeta.energy@gnu.org <help-ncurses-bounces+brad.hines=planeta.energy@gnu.org> On Behalf Of Archimedes Gaviola 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 backspace key (ch == KEY_BACKSPACE) is working. For the program with the window, I expect it to behave similar to the plain program but the function keys such F5 to F12 are showing codes on the screen as well as Insert, Delete, Page Up and Page Down keys are also showing codes. Only F1, F2, F3 and F4 are behaving expectedly. The same thing happens to the Enter/return and backspace keys I use (ch == '\n') and (ch == '\b') to get them working. I need your help in this case if there's something I missed in the Ncurses initialization parameters or maybe a sort of environment variable configuration problem with my FreeBSD OS. My FreeBSD system is using xterm. pangi@siquijor:~ # echo $TERM FreeBSD version: FreeBSD 14.0-CURRENT (arm64) Ncurses version: #define NCURSES_VERSION_MAJOR 6 1. Plain C program (without window) #include <ncurses.h> 2. Plain C derived program (with window) #include <ncurses.h> Thanks and best regards, Archimedes |
[Prev in Thread] | Current Thread | [Next in Thread] |