aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/termkey.c b/termkey.c
index e080fec..2bd6da1 100644
--- a/termkey.c
+++ b/termkey.c
@@ -189,6 +189,7 @@ static TermKey *termkey_alloc(void)
tk->buffstart = 0;
tk->buffcount = 0;
tk->buffsize = 256; /* bytes */
+ tk->hightide = 0;
tk->restore_termios_valid = 0;
@@ -744,6 +745,12 @@ static TermKeyResult peekkey(TermKey *tk, TermKeyKey *key, int force, size_t *nb
fprintf(stderr, "\n");
#endif
+ if(tk->hightide) {
+ tk->buffstart += tk->hightide;
+ tk->buffcount -= tk->hightide;
+ tk->hightide = 0;
+ }
+
TermKeyResult ret;
struct TermKeyDriverNode *p;
for(p = tk->drivers; p; p = p->next) {
@@ -1310,6 +1317,9 @@ size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, T
case TERMKEY_TYPE_POSITION:
l = snprintf(buffer + pos, len - pos, "Position");
break;
+ case TERMKEY_TYPE_UNKNOWN_CSI:
+ l = snprintf(buffer + pos, len - pos, "CSI %c", key->code.number & 0xff);
+ break;
}
if(l <= 0) return pos;
@@ -1413,6 +1423,7 @@ int termkey_keycmp(TermKey *tk, const TermKeyKey *key1p, const TermKeyKey *key2p
return key1.code.sym - key2.code.sym;
break;
case TERMKEY_TYPE_FUNCTION:
+ case TERMKEY_TYPE_UNKNOWN_CSI:
if(key1.code.number != key2.code.number)
return key1.code.number - key2.code.number;
break;