My recent fix for programmable function keys in syscons only worked

when TEKEN_CONS25 is configured.  Fix this by adding a function to
set the flag that enables the fix and always calling this function
for syscons.

Expand the man page for teken_set_cons25().  This function is not
very useful since it can only set but not clear 1 flag.  In practice,
it is only used when TEKEN_CONS25 is configured and all that does is
choose the the default emulation for syscons at compile time.
This commit is contained in:
Bruce Evans 2019-02-05 16:59:29 +00:00
parent 6fd2dcd428
commit 3a19918442
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343778
4 changed files with 27 additions and 3 deletions

View File

@ -144,6 +144,7 @@ scteken_init(scr_stat *scp, void **softc, int code)
#ifdef TEKEN_CONS25
teken_set_cons25(&ts->ts_teken);
#endif /* TEKEN_CONS25 */
teken_set_cons25keys(&ts->ts_teken);
scteken_sync_internal(scp, ts);
break;
}

View File

@ -66,6 +66,8 @@
.Fn teken_set_8bit "teken_t *t"
.Ft void
.Fn teken_set_cons25 "teken_t *t"
.Ft void
.Fn teken_set_cons25keys "teken_t *t"
.Sh DESCRIPTION
The
.Nm
@ -194,11 +196,24 @@ which can be used to support character sets like CP437 and ISO-8859-1.
.Pp
The
.Fn teken_set_cons25
function switches terminal emulation to
function sets the terminal emulation to
.Dv cons25 ,
which is used by versions of
which was the default for
.Xr syscons 4
in versions of
.Fx
prior to 9.0.
This function is only useful for initialization.
The emulation can be changed at any time using an escape sequence,
and this function is not used then.
.Pp
The
.Fn teken_set_cons25keys
function tells the
.Fn teken_get_sequence
function to not interpret special keys in
.Dv cons25
mode.
.Sh SEE ALSO
.Xr ncurses 3 ,
.Xr termcap 3 ,

View File

@ -412,7 +412,14 @@ void
teken_set_cons25(teken_t *t)
{
t->t_stateflags |= TS_CONS25 | TS_CONS25KEYS;
t->t_stateflags |= TS_CONS25;
}
void
teken_set_cons25keys(teken_t *t)
{
t->t_stateflags |= TS_CONS25KEYS;
}
/*

View File

@ -212,6 +212,7 @@ const char *teken_get_sequence(const teken_t *, unsigned int);
/* Legacy features. */
void teken_set_8bit(teken_t *);
void teken_set_cons25(teken_t *);
void teken_set_cons25keys(teken_t *);
/* Color conversion. */
teken_color_t teken_256to16(teken_color_t);