summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2021-04-20 06:35:54 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2021-06-10 09:20:56 +0100
commit825feac9f8f8aa10ec69932ab6ea52e58586e058 (patch)
treee3a717b54adb1ffabab4c538ae8f49e02119ea19
parentd8c006925464ce50d92aee913aa452acf2033173 (diff)
Add another couple of keys needed for extended keys, GitHub issue 2658.
-rw-r--r--key-bindings.c6
-rw-r--r--key-string.c10
-rw-r--r--tty-keys.c5
3 files changed, 17 insertions, 4 deletions
diff --git a/key-bindings.c b/key-bindings.c
index b47f6ff7..467c7f93 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -215,6 +215,9 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
if (repeat)
bd->flags |= KEY_BINDING_REPEAT;
bd->cmdlist = cmdlist;
+
+ log_debug("%s: %#llx %s = %s", __func__, bd->key,
+ key_string_lookup_key(bd->key, 1), cmd_list_print(bd->cmdlist, 0));
}
void
@@ -231,6 +234,9 @@ key_bindings_remove(const char *name, key_code key)
if (bd == NULL)
return;
+ log_debug("%s: %#llx %s", __func__, bd->key,
+ key_string_lookup_key(bd->key, 1));
+
RB_REMOVE(key_bindings, &table->key_bindings, bd);
key_bindings_free(bd);
diff --git a/key-string.c b/key-string.c
index 8d60f132..c24a33fc 100644
--- a/key-string.c
+++ b/key-string.c
@@ -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\177";
+ static const char *other = "!#()+,-.0123456789:;<=>'\r\t\177`/";
key_code key, modifiers;
u_int u, i;
struct utf8_data ud, *udp;
@@ -238,8 +238,12 @@ key_string_lookup_string(const char *string)
}
/* Convert the standard control keys. */
- if (key < KEYC_BASE && (modifiers & KEYC_CTRL) &&
- strchr(other, key) == NULL) {
+ if (key < KEYC_BASE &&
+ (modifiers & KEYC_CTRL) &&
+ strchr(other, key) == NULL &&
+ key != 9 &&
+ key != 13 &&
+ key != 27) {
if (key >= 97 && key <= 122)
key -= 96;
else if (key >= 64 && key <= 95)
diff --git a/tty-keys.c b/tty-keys.c
index 5bf4e4a5..3012be3d 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -959,7 +959,10 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
*/
if (nkey & KEYC_CTRL) {
onlykey = (nkey & KEYC_MASK_KEY);
- if (onlykey < 32 && onlykey != 9)
+ if (onlykey < 32 &&
+ onlykey != 9 &&
+ onlykey != 13 &&
+ onlykey != 27)
/* nothing */;
else if (onlykey >= 97 && onlykey <= 122)
onlykey -= 96;