Add TERMKEY_FORMAT_URWID shortcut [thanks Romain Chossart]
This commit is contained in:
parent
e3d0baa846
commit
8bed1fdbf0
|
@ -43,6 +43,9 @@ The following shortcuts are provided for common combinations of format bits:
|
||||||
.TP
|
.TP
|
||||||
.B TERMKEY_FORMAT_VIM
|
.B TERMKEY_FORMAT_VIM
|
||||||
Shortcut to set \fBALTISMETA\fP and \fBWRAPBRACKET\fP, to give an output close to the format the \fIvim\fP editor uses.
|
Shortcut to set \fBALTISMETA\fP and \fBWRAPBRACKET\fP, to give an output close to the format the \fIvim\fP editor uses.
|
||||||
|
.TP
|
||||||
|
.B TERMKEY_FORMAT_URWID
|
||||||
|
Shortcut to set \fBALTISMETA\fP, \fBLONGMOD\fP, \fBLOWERMOD\fP, \fBSPACEMOD\fP and \fBLOWERSPACE\fP, to give an output close to the format the \fIurwid\fP python library uses.
|
||||||
.PP
|
.PP
|
||||||
When formatting a \fBTERMKEY_TYPE_UNICODE\fP key structure, this function uses the \fIutf8\fP member. If this member contains an empty string (i.e. its first character is 0) then this member will be prefilled by the function from the \fIcode.number\fP member. This can be convenient when the key structure is being constructed programatically by user code.
|
When formatting a \fBTERMKEY_TYPE_UNICODE\fP key structure, this function uses the \fIutf8\fP member. If this member contains an empty string (i.e. its first character is 0) then this member will be prefilled by the function from the \fIcode.number\fP member. This can be convenient when the key structure is being constructed programatically by user code.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
|
|
|
@ -225,6 +225,8 @@ typedef enum {
|
||||||
/* Some useful combinations */
|
/* Some useful combinations */
|
||||||
|
|
||||||
#define TERMKEY_FORMAT_VIM (TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_WRAPBRACKET)
|
#define TERMKEY_FORMAT_VIM (TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_WRAPBRACKET)
|
||||||
|
#define TERMKEY_FORMAT_URWID (TERMKEY_FORMAT_LONGMOD|TERMKEY_FORMAT_ALTISMETA| \
|
||||||
|
TERMKEY_FORMAT_LOWERMOD|TERMKEY_FORMAT_SPACEMOD|TERMKEY_FORMAT_LOWERSPACE)
|
||||||
|
|
||||||
size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
|
size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
|
||||||
const char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyFormat format);
|
const char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyFormat format);
|
||||||
|
|
Loading…
Reference in New Issue