From efc5b7e088fc219993f22dc827022b143913c1f8 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Fri, 30 Nov 2012 15:36:06 +0000 Subject: Try to handle position reports -and- F3 concurrently.. somehow.. argh --- driver-csi.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'driver-csi.c') diff --git a/driver-csi.c b/driver-csi.c index f4de6a8..ae0b50d 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -258,19 +258,27 @@ TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKe /* * Handler for CSI R position reports + * A plain CSI R with no arguments is probably actually */ static TermKeyResult handle_csi_R(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args) { switch(cmd) { case 'R': - if(args < 2) - return TERMKEY_RES_NONE; - - key->type = TERMKEY_TYPE_POSITION; - termkey_key_set_linecol(key, arg[1], arg[0]); - - return TERMKEY_RES_KEY; + switch(args) { + case 0: + key->type = TERMKEY_TYPE_FUNCTION; + key->code.number = 3; + return TERMKEY_RES_KEY; + + case 2: + key->type = TERMKEY_TYPE_POSITION; + termkey_key_set_linecol(key, arg[1], arg[0]); + return TERMKEY_RES_KEY; + + default: + return TERMKEY_RES_NONE; + } default: return TERMKEY_RES_NONE; } -- cgit v1.2.3