Key control: escape one-char keys with apostrophes

This commit is contained in:
Martin Pulec
2019-07-09 10:53:37 +02:00
parent 23c33399ec
commit 7fbde0c649

View File

@@ -319,15 +319,12 @@ static string get_keycode_representation(int64_t ch) {
case K_LEFT: return "KEY_LEFT";
case K_RIGHT: return "KEY_RIGHT";
}
if (ch == ' ') {
return "' '";
}
if (ch < UCHAR_MAX && isprint(ch)) {
return string(1, ch);
if (ch <= UCHAR_MAX && isprint(ch)) {
return string("'") + string(1, ch) + "'";
}
if (is_utf8(ch)) {
return get_utf8_representation(ch);
return string("'") + get_utf8_representation(ch) + "'";
}
stringstream oss;