diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-26 17:46:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-26 17:46:33 +0000 |
commit | fd2ef18a7004fb35dbe40b99765609189827a6f8 (patch) | |
tree | 4ba4edcda169febe60a64950f764f8fbfd1596f5 /input-keys.c | |
parent | c92c2bfb10d9c94acf0d453d9b4e71d6d696e8af (diff) | |
download | rtmux-fd2ef18a7004fb35dbe40b99765609189827a6f8.tar.gz rtmux-fd2ef18a7004fb35dbe40b99765609189827a6f8.tar.bz2 rtmux-fd2ef18a7004fb35dbe40b99765609189827a6f8.zip |
Rewrite xterm-keys code (both input and output) so that works (doesn't always
output the same modifiers, accepts all the possible input keys) and is more
understandable.
Diffstat (limited to 'input-keys.c')
-rw-r--r-- | input-keys.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/input-keys.c b/input-keys.c index 0d9e3222..c276c498 100644 --- a/input-keys.c +++ b/input-keys.c @@ -174,6 +174,18 @@ input_key(struct window_pane *wp, int key) return; } + /* + * Then try to look this up as an xterm key, if the flag to output them + * is set. + */ + if (options_get_number(&wp->window->options, "xterm-keys")) { + if ((out = xterm_keys_lookup(key)) != NULL) { + buffer_write(wp->out, out, strlen(out)); + xfree(out); + return; + } + } + /* Otherwise look the key up in the table. */ for (i = 0; i < nitems(input_keys); i++) { ike = &input_keys[i]; |