.TH fnkey "" "" Command
.PC "Set/print function keys for the console"
\fBfnkey [ \fIn\fB [ \fIstring\fB ] ]\fR
.PP
.HS
Sets function key \fIn\fR to send \fIstring\fR; if no \fIstring\fR, set it
to send nothing.
If no arguments, \fBfnkey\fR prints the function keys.
.HE
.II "function keys"
.II "keys, function"
The console keyboard of a \*(CO system includes ten
programmable function keys, labeled
.B F1
through
.BR F10 .
Initially, these are programmed to send the escape sequences set by the
.B nkb
keyboard driver.
.PP
The command
.B fnkey
programs function key
.BI F n
to send
.I string,
where
.I n
is a number from one through ten.
If no
.I string
is given,
.B fnkey
resets
.BI F n
to send nothing.
.PP
With no argument,
.B fnkey
prints the current string for each programmed function key.
.PP
.B fnkey
also lets you change the default bindings for other special
or function keys.
See Lexicon articles
.B "keyboard tables"
and
.B nkb
for details.
.SH Example
To set function key \fBF2\fR to execute the \*(CO command
.BR date ,
use the following command:
.DM
	fnkey 2 'date
	\&'
.DE
.PP
If you type
.B fnkey
without any arguments, it displays the binding of all function
keys including the following:
.DM
	F2:  date\en
.DE
.SH Files
.B /dev/console
.SH "See Also"
.Xr "commands," commands
.Xr "keyboard," keyboard
.Xr "vtnkb" vtnkb
.SH Diagnostics
.B fnkey
prints
.DM
	cannot open /dev/console
.DE
.PP
if you lack permission to open
.BR /dev/console .
