From fd2ef18a7004fb35dbe40b99765609189827a6f8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 26 Oct 2009 17:46:33 +0000 Subject: 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. --- input-keys.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'input-keys.c') 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]; -- cgit