Renamed snprint_key() to strfkey(); provide redirection trampoline
This commit is contained in:
parent
280047e745
commit
26ef76349e
|
@ -6,7 +6,7 @@
|
|||
static void on_key(TermKey *tk, TermKeyKey *key)
|
||||
{
|
||||
char buffer[50];
|
||||
termkey_snprint_key(tk, buffer, sizeof buffer, key, TERMKEY_FORMAT_VIM);
|
||||
termkey_strfkey(tk, buffer, sizeof buffer, key, TERMKEY_FORMAT_VIM);
|
||||
printf("%s\n", buffer);
|
||||
}
|
||||
|
||||
|
|
2
demo.c
2
demo.c
|
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
|
|||
printf("\e[?%dhMouse mode active\n", mouse);
|
||||
|
||||
while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) {
|
||||
termkey_snprint_key(tk, buffer, sizeof buffer, &key, format);
|
||||
termkey_strfkey(tk, buffer, sizeof buffer, &key, format);
|
||||
printf("%s\n", buffer);
|
||||
|
||||
if(key.type == TERMKEY_TYPE_UNICODE &&
|
||||
|
|
|
@ -935,7 +935,13 @@ static TermKeySym register_c0_full(TermKey *tk, TermKeySym sym, int modifier_set
|
|||
return sym;
|
||||
}
|
||||
|
||||
/* Previous name for this function */
|
||||
size_t termkey_snprint_key(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format)
|
||||
{
|
||||
return termkey_strfkey(tk, buffer, len, key, format);
|
||||
}
|
||||
|
||||
size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format)
|
||||
{
|
||||
size_t pos = 0;
|
||||
size_t l = 0;
|
||||
|
|
|
@ -189,6 +189,9 @@ typedef enum {
|
|||
|
||||
#define TERMKEY_FORMAT_VIM (TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_WRAPBRACKET)
|
||||
|
||||
size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
|
||||
|
||||
// Old name for termkey_strfkey()
|
||||
size_t termkey_snprint_key(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
|
||||
|
||||
// Legacy name typedefs
|
||||
|
|
Loading…
Reference in New Issue