aboutsummaryrefslogtreecommitdiff
path: root/tty-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 /tty-keys.c
parent1c4b7d33b156abeb019ecf19c320b5af1c8ccdfa (diff)
downloadrtmux-10aab825394541df3140bcb4e49b6a0e05997f8e.tar.gz
rtmux-10aab825394541df3140bcb4e49b6a0e05997f8e.tar.bz2
rtmux-10aab825394541df3140bcb4e49b6a0e05997f8e.zip
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 'tty-keys.c')
-rw-r--r--tty-keys.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tty-keys.c b/tty-keys.c
index c64bcd16..37302598 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -1,4 +1,4 @@
-/* $Id: tty-keys.c,v 1.36 2009-10-28 23:01:44 tcunha Exp $ */
+/* $Id: tty-keys.c,v 1.37 2009-10-28 23:03:51 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -341,6 +341,13 @@ tty_keys_next(struct tty *tty, int *key, struct mouse_event *mouse)
goto found;
}
+ /* Not found. Try to parse a key with an xterm-style modifier. */
+ *key = xterm_keys_find(buf, len, &size);
+ if (*key != KEYC_NONE) {
+ buffer_remove(tty->in, size);
+ goto found;
+ }
+
/* Escape but no key string. If the timer isn't started, start it. */
if (!(tty->flags & TTY_ESCAPE)) {
tv.tv_sec = 0;