I have some hard questions about consoles, both ttyvN and pts/N, and also some curses (system curses) functionality. I have to say that I still did not try them, the system is compiling and installing ports.
What I wish to do is to add key maps, that is shift+numpad keys (and also twins non numpad keys) in ttyvN consoles. I read termcap(5), kbdmap(5), atkbd(4), kbdcontrol(1) and the keybord map file I'm using /usr/share/syscons/keymaps/it.iso.kbd.
In that file I can define fkeyNs where N is a number from 65 to 96, that are spare, then assign them a string using the command
1. Is there any other way to specify that keys? That is, in some configuration file (rc.conf).
I never digged inside termcap and terminfo, so yesterday I take time to read at least termcap after looking at /etc/ttys, /etc/gettytab and /usr/share/misc/termcap. I understood few things, but... one is that a termcap entry must not exceed 1023 bytes and that xterm, xterm-color, xterm-16color both has 8 colors and this match with my curses test program.
In any xterm, both in ttyv and pts, the shift+numpad keys are not mapped, well in pts using my curses test program, they are trapped but not translated to KEY_xxx constants. I thought they can be inserted in termcap but perhaps the item will exceed the size limit, otherwise I can add them with the curses function [MAN=3X]define_key[/MAN] and it works as expected. However, in termcap database I read this in the comment:
2. How to use terminfo instead of termcap?
Last question is about system ncurses (v5.7) and multibyte/unicode translation. The [MAN=3X]get_wch[/MAN] function does not translate UTF-8 characters, i.e. pressing the 'ì' char it give me 2 chars:
the function does not translate it in one call. I set the locale before to call [MAN=3X]initscr[/MAN] with
and also with
3. Which is the right way to get UTF-8 chars to be translated in one get_wch (or getch) call?
Perhaps using terminfo instead of termcap resolves the troubles I run in th epast with devel/ncurses port.
Thanks for your help.
What I wish to do is to add key maps, that is shift+numpad keys (and also twins non numpad keys) in ttyvN consoles. I read termcap(5), kbdmap(5), atkbd(4), kbdcontrol(1) and the keybord map file I'm using /usr/share/syscons/keymaps/it.iso.kbd.
In that file I can define fkeyNs where N is a number from 65 to 96, that are spare, then assign them a string using the command
# kbdcontrol -f N 'string'
1. Is there any other way to specify that keys? That is, in some configuration file (rc.conf).
I never digged inside termcap and terminfo, so yesterday I take time to read at least termcap after looking at /etc/ttys, /etc/gettytab and /usr/share/misc/termcap. I understood few things, but... one is that a termcap entry must not exceed 1023 bytes and that xterm, xterm-color, xterm-16color both has 8 colors and this match with my curses test program.
In any xterm, both in ttyv and pts, the shift+numpad keys are not mapped, well in pts using my curses test program, they are trapped but not translated to KEY_xxx constants. I thought they can be inserted in termcap but perhaps the item will exceed the size limit, otherwise I can add them with the curses function [MAN=3X]define_key[/MAN] and it works as expected. However, in termcap database I read this in the comment:
Code:
# $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $
#
# Note:
# termcap format is limited to 1023 characters. This set of descriptions
# is a subset of the terminfo, since not all features can be fit into
# that limit. The 'xterm' description supports color. The monochrome
# 'xterm-mono' drops color in favor of additional function keys. [B][color="DarkOrange"]If you
# need both, use terminfo[/color][/B].
#
# The 1023-character limit applies to each entry after resolving the
# "tc=" strings. Some implementations may discount all or part of the
# formatting characters in the entry (i.e., the backslash newline tab
# colon). GNU termcap does not have this limit.
#
# I checked the limits using ncurses "captoinfo -CrTUvx", which prints
# the resolved length of each entry in a comment at the end - T.*beep**beep**beep**beep*ey
2. How to use terminfo instead of termcap?
Last question is about system ncurses (v5.7) and multibyte/unicode translation. The [MAN=3X]get_wch[/MAN] function does not translate UTF-8 characters, i.e. pressing the 'ì' char it give me 2 chars:
Code:
Key: M-C [195]
Key: M-, [172]
the function does not translate it in one call. I set the locale before to call [MAN=3X]initscr[/MAN] with
Code:
setlocale (LC_ALL, NULL);
and also with
Code:
setlocale (LC_ALL, "UTF-8");
3. Which is the right way to get UTF-8 chars to be translated in one get_wch (or getch) call?
Perhaps using terminfo instead of termcap resolves the troubles I run in th epast with devel/ncurses port.
Thanks for your help.