aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/termkey.c b/termkey.c
index b40059d..4df1294 100644
--- a/termkey.c
+++ b/termkey.c
@@ -679,6 +679,11 @@ termkey_result termkey_getkey(termkey_t *tk, termkey_key *key)
if(ret == TERMKEY_RES_KEY)
eat_bytes(tk, nbytes);
+ if(ret == TERMKEY_RES_AGAIN)
+ /* Call peekkey() again in force mode to obtain whatever it can */
+ (void)peekkey(tk, key, 1, &nbytes);
+ /* Don't eat it yet though */
+
return ret;
}