aboutsummaryrefslogtreecommitdiff
path: root/key-string.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2021-04-28 09:18:04 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2021-04-28 09:18:04 +0100
commite2d01795d2501f6097bb13129995a6d0a86af419 (patch)
tree65113b35460fbea1744bbeb8a7df42354f7ad266 /key-string.c
parent589d3eb48fcb30163c9ac3f4b8d5e802e3f45118 (diff)
downloadrtmux-e2d01795d2501f6097bb13129995a6d0a86af419.tar.gz
rtmux-e2d01795d2501f6097bb13129995a6d0a86af419.tar.bz2
rtmux-e2d01795d2501f6097bb13129995a6d0a86af419.zip
Move "special" keys into the Unicode PUA rather than making them high a top bit
set, some compilers cannot handle enums that are larger than int. GitHub issue 2673.
Diffstat (limited to 'key-string.c')
-rw-r--r--key-string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/key-string.c b/key-string.c
index c24a33fc..b41eaa73 100644
--- a/key-string.c
+++ b/key-string.c
@@ -238,7 +238,7 @@ key_string_lookup_string(const char *string)
}
/* Convert the standard control keys. */
- if (key < KEYC_BASE &&
+ if (KEYC_IS_UNICODE(key) &&
(modifiers & KEYC_CTRL) &&
strchr(other, key) == NULL &&
key != 9 &&
@@ -368,8 +368,8 @@ key_string_lookup_key(key_code key, int with_flags)
goto out;
}
- /* Is this a UTF-8 key? */
- if (key > 127 && key < KEYC_BASE) {
+ /* Is this a Unicode key? */
+ if (KEYC_IS_UNICODE(key)) {
utf8_to_data(key, &ud);
off = strlen(out);
memcpy(out + off, ud.data, ud.size);