diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2014-01-23 23:56:41 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2014-01-23 23:56:41 +0000 |
commit | ff8d7141423d2b9d1d432b955ecae4430a7a652c (patch) | |
tree | faeed47c1587a9dc92279143a89c8cce349ed2df | |
parent | ab4c1c3d3ea3c4e0c721dc61e16c3450929cf54c (diff) | |
download | termo-ff8d7141423d2b9d1d432b955ecae4430a7a652c.tar.gz termo-ff8d7141423d2b9d1d432b955ecae4430a7a652c.tar.xz termo-ff8d7141423d2b9d1d432b955ecae4430a7a652c.zip |
Print UTF-8/RAW mode on startup; print 'Key ' before normal keys to debug UTF-8 parse errors
-rw-r--r-- | demo.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -46,6 +46,11 @@ int main(int argc, char *argv[]) exit(1); } + if(termkey_get_flags(tk) & TERMKEY_FLAG_UTF8) + printf("Termkey in UTF-8 mode\n"); + else if(termkey_get_flags(tk) & TERMKEY_FLAG_RAW) + printf("Termkey in RAW mode\n"); + TermKeyResult ret; TermKeyKey key; @@ -81,7 +86,7 @@ int main(int argc, char *argv[]) printf("Unrecognised CSI %c %ld;%ld %c%c\n", (char)(command >> 8), args[0], args[1], (char)(command >> 16), (char)command); } else { - printf("%s\n", buffer); + printf("Key %s\n", buffer); } if(key.type == TERMKEY_TYPE_UNICODE && |