Denote general status with return codes, not special key symbols

This commit is contained in:
Paul LeoNerd Evans
2008-02-07 01:17:59 +00:00
parent a503403226
commit 6294cca6f9
3 changed files with 54 additions and 52 deletions

3
demo.c
View File

@@ -20,9 +20,10 @@ int main(int argc, char *argv[]) {
termkey_t *tk = termkey_new(0, TERMKEY_FLAG_CONVERTKP);
termkey_result ret;
termkey_key key;
while(termkey_waitkey(tk, &key) && key.code != TERMKEY_SYM_EOF) {
while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) {
if(key.flags & TERMKEY_KEYFLAG_SPECIAL)
printf("Key %s%s%s%s (code %d)\n",
key.modifiers & TERMKEY_KEYMOD_SHIFT ? "S-" : "",