diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-04-07 10:01:19 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-04-07 10:01:19 +0100 |
commit | 998a6b0aea560a3c43c23b38b039e9f77d067fe3 (patch) | |
tree | b58d0a6151faaffde3566d6173927720228a9065 /key-string.c | |
parent | db97bef60b881ca42b0296e56d685ac67e7e7a15 (diff) | |
parent | ba999966768b3ede648a361dd9b17ca81bdda173 (diff) | |
download | rtmux-998a6b0aea560a3c43c23b38b039e9f77d067fe3.tar.gz rtmux-998a6b0aea560a3c43c23b38b039e9f77d067fe3.tar.bz2 rtmux-998a6b0aea560a3c43c23b38b039e9f77d067fe3.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'key-string.c')
-rw-r--r-- | key-string.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/key-string.c b/key-string.c index 194fdef2..0633ed22 100644 --- a/key-string.c +++ b/key-string.c @@ -45,9 +45,9 @@ static const struct { { "F11", KEYC_F11|KEYC_IMPLIED_META }, { "F12", KEYC_F12|KEYC_IMPLIED_META }, { "IC", KEYC_IC|KEYC_IMPLIED_META }, - { "Insert", KEYC_IC|KEYC_IMPLIED_META }, + { "Insert", KEYC_IC|KEYC_IMPLIED_META }, { "DC", KEYC_DC|KEYC_IMPLIED_META }, - { "Delete", KEYC_DC|KEYC_IMPLIED_META }, + { "Delete", KEYC_DC|KEYC_IMPLIED_META }, { "Home", KEYC_HOME|KEYC_IMPLIED_META }, { "End", KEYC_END|KEYC_IMPLIED_META }, { "NPage", KEYC_NPAGE|KEYC_IMPLIED_META }, @@ -70,7 +70,7 @@ static const struct { { "Right", KEYC_RIGHT|KEYC_CURSOR|KEYC_IMPLIED_META }, /* Numeric keypad. */ - { "KP/", KEYC_KP_SLASH|KEYC_KEYPAD }, + { "KP/", KEYC_KP_SLASH|KEYC_KEYPAD }, { "KP*", KEYC_KP_STAR|KEYC_KEYPAD }, { "KP-", KEYC_KP_MINUS|KEYC_KEYPAD }, { "KP7", KEYC_KP_SEVEN|KEYC_KEYPAD }, @@ -164,7 +164,7 @@ key_string_get_modifiers(const char **string) key_code key_string_lookup_string(const char *string) { - static const char *other = "!#()+,-.0123456789:;<=>'\r\t"; + static const char *other = "!#()+,-.0123456789:;<=>'\r\t\177"; key_code key, modifiers; u_int u, i; struct utf8_data ud, *udp; @@ -181,8 +181,8 @@ key_string_lookup_string(const char *string) /* Is this a hexadecimal value? */ if (string[0] == '0' && string[1] == 'x') { - if (sscanf(string + 2, "%x", &u) != 1) - return (KEYC_UNKNOWN); + if (sscanf(string + 2, "%x", &u) != 1) + return (KEYC_UNKNOWN); mlen = wctomb(m, u); if (mlen <= 0 || mlen > MB_LEN_MAX) return (KEYC_UNKNOWN); @@ -238,11 +238,11 @@ key_string_lookup_string(const char *string) } /* Convert the standard control keys. */ - if (key < KEYC_BASE && (modifiers & KEYC_CTRL) && !strchr(other, key)) { + if (key < KEYC_BASE && (modifiers & KEYC_CTRL) && + strchr(other, key) == NULL && + (key < 64 || key > 95)) { if (key >= 97 && key <= 122) key -= 96; - else if (key >= 64 && key <= 95) - key -= 64; else if (key == 32) key = 0; else if (key == 63) |