Make termkey_getkey() set a peeked key structure if it returns TERMKEY_RET_AGAIN
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user