Cope correctly with XTerm's modified Unicode reporting of Ctrl-C for termination

This commit is contained in:
Paul LeoNerd Evans 2008-02-23 23:17:31 +00:00
parent db22cc6dc7
commit eb2fed629d

4
demo.c
View File

@ -17,14 +17,14 @@ int main(int argc, char *argv[]) {
termkey_get_keyname(tk, key.code),
key.code);
else
printf("Key %s%s%s%s (U+%04X)\n",
printf("Unicode %s%s%s%s (U+%04X)\n",
key.modifiers & TERMKEY_KEYMOD_SHIFT ? "Shift-" : "",
key.modifiers & TERMKEY_KEYMOD_ALT ? "Alt-" : "",
key.modifiers & TERMKEY_KEYMOD_CTRL ? "Ctrl-" : "",
key.utf8,
key.code);
if(key.modifiers & TERMKEY_KEYMOD_CTRL && key.code == 'C')
if(key.modifiers & TERMKEY_KEYMOD_CTRL && (key.code == 'C' || key.code == 'c'))
break;
}