summaryrefslogtreecommitdiffstats
path: root/key-string.c
diff options
context:
space:
mode:
authornicm <nicm>2019-07-09 14:03:12 +0000
committernicm <nicm>2019-07-09 14:03:12 +0000
commitfc2016dbb665f01e795a89632a1bb74294bfc4e1 (patch)
tree452c47afaec3fde07753bc65df05c35da9a23aae /key-string.c
parentad11d49d640c911b42c5292b5f5b7dbdffb4908b (diff)
Add a -H flag to send-keys to send literal keys given as hex numbers
(needed for control clients to send mouse sequences). Also add some format flags for UTF-8 and SGR mouse mode. Requested by Bradley Smith in GitHub issues 1832 and 1833.
Diffstat (limited to 'key-string.c')
-rw-r--r--key-string.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/key-string.c b/key-string.c
index 8442727d..a1ef4f51 100644
--- a/key-string.c
+++ b/key-string.c
@@ -284,6 +284,12 @@ key_string_lookup_key(key_code key)
return (out);
}
+ /* Literal keys are themselves. */
+ if (key & KEYC_LITERAL) {
+ snprintf(out, sizeof out, "%c", (int)(key & 0xff));
+ 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