summaryrefslogtreecommitdiffstats
path: root/input-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-25 07:30:08 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-25 07:30:08 +0000
commit758efb394758a0025239e694e1b8db1af3e2f4ab (patch)
treeeb8d3e84b6df25e372d0bd72b44832be555a36ec /input-keys.c
parentcb6c14502b671d291bebcb92d33f9b518a4879f1 (diff)
Handle escaped keys properly and use M-f/M-b in copy mode.
Diffstat (limited to 'input-keys.c')
-rw-r--r--input-keys.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/input-keys.c b/input-keys.c
index e53895e8..b2336b25 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -1,4 +1,4 @@
-/* $Id: input-keys.c,v 1.9 2008-06-23 16:58:49 nicm Exp $ */
+/* $Id: input-keys.c,v 1.10 2008-06-25 07:30:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -68,8 +68,14 @@ input_key(struct window *w, int key)
{
u_int i;
- log_debug2("writing key %d", key);
- if (key != KEYC_NONE && key >= 0) {
+ log_debug2("writing key %x", key);
+
+ if (KEYC_ISESCAPE(key)) {
+ buffer_write8(w->out, '\033');
+ key = KEYC_REMOVEESCAPE(key);
+ }
+
+ if (key != KEYC_NONE && key < KEYC_OFFSET) {
buffer_write8(w->out, (uint8_t) key);
return;
}