diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-03-15 22:01:27 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-03-15 22:01:27 +0000 |
commit | 55aeaffb1a55019fec691d39a17632b4e7841fad (patch) | |
tree | e699cc468fc0368a46a60bb5e69ed7427b6da7ac /key-string.c | |
parent | c859748210cef2378660997db810d94f28fe0ac7 (diff) | |
parent | 882d0b785d52843b76a387ff3c6bf2cae46fc7ec (diff) | |
download | rtmux-55aeaffb1a55019fec691d39a17632b4e7841fad.tar.gz rtmux-55aeaffb1a55019fec691d39a17632b4e7841fad.tar.bz2 rtmux-55aeaffb1a55019fec691d39a17632b4e7841fad.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'key-string.c')
-rw-r--r-- | key-string.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/key-string.c b/key-string.c index d2b31e03..38e5b8a7 100644 --- a/key-string.c +++ b/key-string.c @@ -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) |