From f5cbf9eb57b0dd38ed8054eff02defec1602f57a Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Tue, 24 Apr 2012 17:27:48 +0100 Subject: Also handle CSI R; position report replies to CSI 6n --- driver-csi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'driver-csi.c') diff --git a/driver-csi.c b/driver-csi.c index 1719e70..d305356 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -187,6 +187,21 @@ static TermKeyResult handle_csi_mouse(TermKey *tk, TermKeyKey *key, int cmd, lon return TERMKEY_RES_NONE; } +/* + * Handler for CSI R position reports + */ + +static TermKeyResult handle_csi_position(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args) +{ + if(args < 2) + return TERMKEY_RES_NONE; + + key->type = TERMKEY_TYPE_POSITION; + termkey_key_set_linecol(key, arg[0], arg[1]); + + return TERMKEY_RES_KEY; +} + static int register_keys(void) { int i; @@ -268,6 +283,8 @@ static int register_keys(void) csi_handlers['M' - 0x40] = &handle_csi_mouse; csi_handlers['m' - 0x40] = &handle_csi_mouse; + csi_handlers['R' - 0x40] = &handle_csi_position; + keyinfo_initialised = 1; return 1; } -- cgit v1.2.3