aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-12-10 00:38:21 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-12-10 00:38:21 +0000
commit696c1455998a8282b23155449eda880aab157858 (patch)
tree7331221c1b9695a95e4c5ed2a7a435477ef715ac /termkey.c
parentef669c134d9352d88ae020803c7ee280083523f8 (diff)
downloadtermo-696c1455998a8282b23155449eda880aab157858.tar.gz
termo-696c1455998a8282b23155449eda880aab157858.tar.xz
termo-696c1455998a8282b23155449eda880aab157858.zip
Make termkey_getkey() set a peeked key structure if it returns TERMKEY_RET_AGAIN
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;
}