Fix C-Space key string.

pull/2123/head
nicm 2020-03-15 20:35:52 +00:00
parent fa36e9bc88
commit fa3871b1be
1 changed files with 4 additions and 9 deletions

View File

@ -257,6 +257,10 @@ key_string_lookup_key(key_code key)
return (out);
}
/* Display C-@ as C-Space. */
if ((key & KEYC_MASK_KEY) == 0)
key = ' ' | KEYC_CTRL | (key & KEYC_MASK_MOD);
/* Fill in the modifiers. */
if (key & KEYC_CTRL)
strlcat(out, "C-", sizeof out);
@ -329,15 +333,6 @@ key_string_lookup_key(key_code key)
return (out);
}
/*
* Special case: display C-@ as C-Space. Could do this below in
* the (key >= 0 && key <= 32), but this way we let it be found
* in key_string_table, for the unlikely chance that we might
* change its name.
*/
if ((key & KEYC_MASK_KEY) == 0)
key = ' ' | KEYC_CTRL | (key & KEYC_MASK_MOD);
/* Try the key against the string table. */
for (i = 0; i < nitems(key_string_table); i++) {
if (key == key_string_table[i].key)