1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

From RDB: according to VT manuals, application cursor keys should

never be enabled when app keypad is disabled. Also CTRL+arrows flips
the application-ness to make it easy to generate the other sequences
if required.

[originally from svn r1105]
This commit is contained in:
Simon Tatham 2001-05-09 13:30:06 +00:00
parent cefaa787ba
commit 9f32a1da35

View File

@ -2759,10 +2759,22 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
if (xkey) { if (xkey) {
if (vt52_mode) if (vt52_mode)
p += sprintf((char *) p, "\x1B%c", xkey); p += sprintf((char *) p, "\x1B%c", xkey);
else if (app_cursor_keys && !cfg.no_applic_c) else {
int app_flg = (app_cursor_keys && !cfg.no_applic_c);
/* VT100 & VT102 manuals both state the app cursor keys
* only work if the app keypad is on.
*/
if (!app_keypad_keys)
app_flg = 0;
/* Useful mapping of Ctrl-arrows */
if (shift_state == 2)
app_flg = !app_flg;
if (app_flg)
p += sprintf((char *) p, "\x1BO%c", xkey); p += sprintf((char *) p, "\x1BO%c", xkey);
else else
p += sprintf((char *) p, "\x1B[%c", xkey); p += sprintf((char *) p, "\x1B[%c", xkey);
}
return p - output; return p - output;
} }
} }