aboutsummaryrefslogtreecommitdiff
path: root/driver-csi.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver-csi.c')
-rw-r--r--driver-csi.c17
1 files changed, 17 insertions, 0 deletions
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;
}