Only recognise DECCPR as a position report, so it is distinct from F3

This commit is contained in:
Paul LeoNerd Evans
2012-11-30 16:12:26 +00:00
parent efc5b7e088
commit c00f6cd3c6
4 changed files with 13 additions and 20 deletions

View File

@@ -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 <F3>
*/
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 'R'|'?'<<8:
if(args < 2)
return TERMKEY_RES_NONE;
case 2:
key->type = TERMKEY_TYPE_POSITION;
termkey_key_set_linecol(key, arg[1], arg[0]);
return TERMKEY_RES_KEY;
key->type = TERMKEY_TYPE_POSITION;
termkey_key_set_linecol(key, arg[1], arg[0]);
return TERMKEY_RES_KEY;
default:
return TERMKEY_RES_NONE;
}
default:
return TERMKEY_RES_NONE;
return handle_csi_ss3_full(tk, key, cmd, arg, args);
}
}