diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-06 22:33:49 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-06 22:33:49 +0100 |
commit | 0b8680daa45d22b3d61b064faaf4114d0cf57d0c (patch) | |
tree | ab6e6e81937f70ef1d40014e8ce8a387fd04e227 /termkey.c | |
parent | 5b24e42d90a57479c702b0e6b53271dd5188db70 (diff) | |
download | termo-0b8680daa45d22b3d61b064faaf4114d0cf57d0c.tar.gz termo-0b8680daa45d22b3d61b064faaf4114d0cf57d0c.tar.xz termo-0b8680daa45d22b3d61b064faaf4114d0cf57d0c.zip |
Added TERMKEY_FORMAT_WRAPBRACKET
Diffstat (limited to 'termkey.c')
-rw-r--r-- | termkey.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -863,6 +863,15 @@ size_t termkey_snprint_key(termkey_t *tk, char *buffer, size_t len, termkey_key int longmod = format & TERMKEY_FORMAT_LONGMOD; + int wrapbracket = (format & TERMKEY_FORMAT_WRAPBRACKET) && + (key->type != TERMKEY_TYPE_UNICODE || key->modifiers != 0); + + if(wrapbracket) { + l = snprintf(buffer + pos, len - pos, "<"); + if(l <= 0) return pos; + pos += l; + } + if(format & TERMKEY_FORMAT_CARETCTRL) { if(key->type == TERMKEY_TYPE_UNICODE && key->modifiers == TERMKEY_KEYMOD_CTRL && @@ -913,5 +922,11 @@ do_codepoint: if(l <= 0) return pos; pos += l; + if(wrapbracket) { + l = snprintf(buffer + pos, len - pos, ">"); + if(l <= 0) return pos; + pos += l; + } + return pos; } |