From c00f6cd3c63e01c84220b607eccf5a2ba2df8f63 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Fri, 30 Nov 2012 16:12:26 +0000 Subject: Only recognise DECCPR as a position report, so it is distinct from F3 --- driver-csi.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'driver-csi.c') diff --git a/driver-csi.c b/driver-csi.c index ae0b50d..3ff41e0 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -257,30 +257,23 @@ TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKe } /* - * Handler for CSI R position reports + * 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': - 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; - } + case 'R'|'?'<<8: + 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; + default: - return TERMKEY_RES_NONE; + return handle_csi_ss3_full(tk, key, cmd, arg, args); } } -- cgit v1.2.3