1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Fix Alt handling in the new shifted-arrow-key support.

As well as affecting the bitmap field in the escape sequence, it was
_also_ having its otherwise standard effect of prefixing Esc to the
whole sequence. It shouldn't do both.
This commit is contained in:
Simon Tatham
2021-10-23 10:52:11 +01:00
parent 6c24cb5c9f
commit a40b581fc1
4 changed files with 19 additions and 6 deletions

View File

@ -7241,16 +7241,18 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
term_schedule_update(term);
}
static int shift_bitmap(bool shift, bool ctrl, bool alt)
static int shift_bitmap(bool shift, bool ctrl, bool alt, bool *consumed_alt)
{
int bitmap = (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0);
if (bitmap)
bitmap++;
if (alt && consumed_alt)
*consumed_alt = true;
return bitmap;
}
int format_arrow_key(char *buf, Terminal *term, int xkey,
bool shift, bool ctrl, bool alt)
bool shift, bool ctrl, bool alt, bool *consumed_alt)
{
char *p = buf;
@ -7283,7 +7285,7 @@ int format_arrow_key(char *buf, Terminal *term, int xkey,
app_flg = !app_flg;
break;
case SHARROW_BITMAP:
bitmap = shift_bitmap(shift, ctrl, alt);
bitmap = shift_bitmap(shift, ctrl, alt, consumed_alt);
break;
}