=== modified file 'demo.c' --- demo.c 2008-10-06 21:33:49 +0000 +++ demo.c 2008-10-06 21:22:09 +0000 @@ -10,10 +10,14 @@ termkey_key key; while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) { - termkey_snprint_key(tk, buffer, sizeof buffer, &key, 0); - printf("%s or ", buffer); - termkey_snprint_key(tk, buffer, sizeof buffer, &key, ~0); - printf("%s\n", buffer); + if(key.type == TERMKEY_TYPE_UNICODE && !key.modifiers) + printf("%s\n", key.utf8); + else { + termkey_snprint_key(tk, buffer, sizeof buffer, &key, 0); + printf("<%s> or ", buffer); + termkey_snprint_key(tk, buffer, sizeof buffer, &key, ~0); + printf("<%s>\n", buffer); + } if(key.type == TERMKEY_TYPE_UNICODE && key.modifiers & TERMKEY_KEYMOD_CTRL && === modified file 'termkey.c' --- termkey.c 2008-10-06 21:33:49 +0000 +++ termkey.c 2008-10-06 21:22:09 +0000 @@ -863,15 +863,6 @@ int longmod = format & TERMKEY_FORMAT_LONGMOD; - int wrapbracket = (format & TERMKEY_FORMAT_WRAPBRACKET) && - (key->type != TERMKEY_TYPE_UNICODE || key->modifiers != 0); - - if(wrapbracket) { - l = snprintf(buffer + pos, len - pos, "<"); - if(l <= 0) return pos; - pos += l; - } - if(format & TERMKEY_FORMAT_CARETCTRL) { if(key->type == TERMKEY_TYPE_UNICODE && key->modifiers == TERMKEY_KEYMOD_CTRL && @@ -922,11 +913,5 @@ if(l <= 0) return pos; pos += l; - if(wrapbracket) { - l = snprintf(buffer + pos, len - pos, ">"); - if(l <= 0) return pos; - pos += l; - } - return pos; } === modified file 'termkey.h' --- termkey.h 2008-10-06 21:33:49 +0000 +++ termkey.h 2008-10-06 21:22:09 +0000 @@ -136,7 +136,6 @@ TERMKEY_FORMAT_LONGMOD = 1, TERMKEY_FORMAT_CARETCTRL = 2, TERMKEY_FORMAT_ALTISMETA = 4, - TERMKEY_FORMAT_WRAPBRACKET = 8, } termkey_format; size_t termkey_snprint_key(termkey_t *tk, char *buffer, size_t len, termkey_key *key, termkey_format format);