Named control character (Tab, Enter, Backspace etc.) should use those
names rather than caret sequences.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
if (key < 0)
return NULL;
- if (key < 0x100 && key != ' ') {
- if (key == 0x7f) {
- return "^?";
- } else if (key & 0x60) {
+ if (key > ' ' && key < 0x100) {
+ if (key & 0x60) {
buf[0] = key;
buf[1] = '\0';
} else {
return name->string;
}
+ if (key < ' ') {
+ buf[0] = '^';
+ buf[1] = key | 0x40;
+ buf[2] = '\0';
+ return buf;
+ }
+
return NULL;
}