diff options
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c index 61c2311fa3..3b2c3c063f 100644 --- a/src/term.c +++ b/src/term.c @@ -5125,7 +5125,7 @@ handle_csi( csi_len, offset, buf, bufsize, buflen); } - // Key without modifier (bad Kitty may send this): + // Key without modifier (Kitty sends this for Esc): // {lead}{key}u else if (argc == 1 && trail == 'u') { @@ -5456,6 +5456,23 @@ check_termcode( } else #endif // FEAT_GUI +#ifdef MSWIN + if (len >= 3 && tp[0] == CSI && tp[1] == KS_EXTRA + && (tp[2] == KE_MOUSEUP + || tp[2] == KE_MOUSEDOWN + || tp[2] == KE_MOUSELEFT + || tp[2] == KE_MOUSERIGHT)) + { + // MS-Windows console sends mouse scroll events encoded: + // - CSI + // - KS_EXTRA + // - {KE_MOUSE[UP|DOWN|LEFT|RIGHT]} + slen = 3; + key_name[0] = tp[1]; + key_name[1] = tp[2]; + } + else +#endif { int mouse_index_found = -1; |