Try to handle position reports -and- F3 concurrently.. somehow.. argh

This commit is contained in:
Paul LeoNerd Evans
2012-11-30 15:36:06 +00:00
parent 8152f9e018
commit efc5b7e088
2 changed files with 24 additions and 6 deletions

View File

@@ -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 <F3>
*/
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;
switch(args) {
case 0:
key->type = TERMKEY_TYPE_FUNCTION;
key->code.number = 3;
return TERMKEY_RES_KEY;
key->type = TERMKEY_TYPE_POSITION;
termkey_key_set_linecol(key, arg[1], arg[0]);
case 2:
key->type = TERMKEY_TYPE_POSITION;
termkey_key_set_linecol(key, arg[1], arg[0]);
return TERMKEY_RES_KEY;
return TERMKEY_RES_KEY;
default:
return TERMKEY_RES_NONE;
}
default:
return TERMKEY_RES_NONE;
}