Also handle CSI R; position report replies to CSI 6n

This commit is contained in:
Paul LeoNerd Evans
2012-04-24 17:27:48 +01:00
parent 6645ee9718
commit f5cbf9eb57
4 changed files with 76 additions and 1 deletions

View File

@@ -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;
}