From 82d45e9f09721cc2ea933102ba9cf9a809294b4d Mon Sep 17 00:00:00 2001 From: Adrian Kocis Date: Sat, 18 Jan 2020 07:08:43 +0000 Subject: [PATCH] Do not send extra escape when alt is pressed together with function or small keypad keys (i.e. Fx or ins/del/home/end/pgup/pgdown keys) --- 0.73_My_PuTTY/windows/window.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/0.73_My_PuTTY/windows/window.c b/0.73_My_PuTTY/windows/window.c index 8b7de99..4e9c193 100644 --- a/0.73_My_PuTTY/windows/window.c +++ b/0.73_My_PuTTY/windows/window.c @@ -6545,9 +6545,38 @@ if( !get_param("PUTTY") && conf_get_int(conf, CONF_disablealtgr) ) { /* Okay, prepare for most alts then ... */ #ifdef MOD_KEYMAPPING if( !GetPuttyFlag() ) { - if (left_alt && shift_state != 1 && !(wParam == VK_UP || wParam == VK_DOWN || wParam == VK_RIGHT || wParam == VK_LEFT)) - *p++ = '\033'; + if (left_alt && shift_state != 1 && !(wParam == VK_UP || wParam == VK_DOWN || wParam == VK_RIGHT || wParam == VK_LEFT)) { + int fkey = 0; + switch (wParam) { + case VK_F1: + case VK_F2: + case VK_F3: + case VK_F4: + case VK_F5: + case VK_F6: + case VK_F7: + case VK_F8: + case VK_F9: + case VK_F10: + case VK_F11: + case VK_F12: + case VK_INSERT: + case VK_DELETE: + case VK_HOME: + case VK_END: + case VK_PRIOR: + case VK_NEXT: + fkey = 1; + break; + default: + break; + } + + if (!(term->funky_type == FUNKY_XTERM && !term->vt52_mode) || fkey == 0) { + *p++ = '\033'; + } } + } else #endif if (left_alt)