\fBtermkey_snprint_key\fP formats a string buffer to contain a human-readable representation of a key event. It fills the \fIbuffer\fP in a way analogous to the \fBsnprintf\fP(3) standard library function.
.PP
The \fIformat\fP argument specifies the format of the output, as a bitmask of the following constants:
.TP
.BTERMKEY_FORMAT_LONGMOD
Print full modifier names e.g. "Shift-" instead of abbreviating to "S-".
.TP
.BTERMKEY_FORMAT_CARETCTRL
If the only modifier is \fBTERMKEY_MOD_CTRL\fP on a plain letter, render it as "^X" rather than "Ctrl-X".
.TP
.BTERMKEY_FORMAT_ALTISMETA
Use the name "Meta" or the letter "M" instead of "Alt" or "A".
.TP
.BTERMKEY_FORMAT_WRAPBRACKET
If the key event is a special key instead of unmodified Unicode, wrap it in "<brackets>".
.PP
The following shortcuts are provided for common combinations of format bits:
.TP
.BTERMKEY_FORMAT_VIM
Shortcut to set \fBALTISMETA\fP and \fBWRAPBRACKET\fP, to give an output close to the format the \fIvim\fP editor uses.
.SH"RETURN VALUE"
\fBtermkey_snprint_key\fP() returns the number of characters written to \fIbuffer\fP.