summaryrefslogtreecommitdiffstats
path: root/input-keys.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-28 23:03:51 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-28 23:03:51 +0000
commit10aab825394541df3140bcb4e49b6a0e05997f8e (patch)
treeb0ba5299ce34c894fa2f8f62e947fdff7138b1cb /input-keys.c
parent1c4b7d33b156abeb019ecf19c320b5af1c8ccdfa (diff)
Sync OpenBSD patchset 459:
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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/input-keys.c b/input-keys.c
index 2b9dbe3b..7d503d57 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -1,4 +1,4 @@
-/* $Id: input-keys.c,v 1.37 2009-10-28 23:00:21 tcunha Exp $ */
+/* $Id: input-keys.c,v 1.38 2009-10-28 23:03:51 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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];