comparison src/term.c @ 31168:25f6c7f77c70 v9.0.0918

patch 9.0.0918: MS-Windows: modifier keys do not work with mouse scroll event Commit: https://github.com/vim/vim/commit/0319306f20d2a5989d1f5639a47d77cebeac2f29 Author: Christopher Plewright <chris@createng.com> Date: Tue Nov 22 12:58:27 2022 +0000 patch 9.0.0918: MS-Windows: modifier keys do not work with mouse scroll event Problem: MS-Windows: modifier keys do not work with mouse scroll events. Solution: Use K_SPECIAL instead of CSI for the modifier keys. (Christopher Plewright, closes #11587)
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Nov 2022 14:00:04 +0100
parents 548241980a27
children f1c345ae4d89
comparison
equal deleted inserted replaced
31167:8cf717ffd0de 31168:25f6c7f77c70
5123 { 5123 {
5124 return len + handle_key_with_modifier(arg, trail, 5124 return len + handle_key_with_modifier(arg, trail,
5125 csi_len, offset, buf, bufsize, buflen); 5125 csi_len, offset, buf, bufsize, buflen);
5126 } 5126 }
5127 5127
5128 // Key without modifier (bad Kitty may send this): 5128 // Key without modifier (Kitty sends this for Esc):
5129 // {lead}{key}u 5129 // {lead}{key}u
5130 else if (argc == 1 && trail == 'u') 5130 else if (argc == 1 && trail == 'u')
5131 { 5131 {
5132 return len + handle_key_without_modifier(arg, 5132 return len + handle_key_without_modifier(arg,
5133 csi_len, offset, buf, bufsize, buflen); 5133 csi_len, offset, buf, bufsize, buflen);
5454 key_name[1] = tp[2]; 5454 key_name[1] = tp[2];
5455 } 5455 }
5456 } 5456 }
5457 else 5457 else
5458 #endif // FEAT_GUI 5458 #endif // FEAT_GUI
5459 #ifdef MSWIN
5460 if (len >= 3 && tp[0] == CSI && tp[1] == KS_EXTRA
5461 && (tp[2] == KE_MOUSEUP
5462 || tp[2] == KE_MOUSEDOWN
5463 || tp[2] == KE_MOUSELEFT
5464 || tp[2] == KE_MOUSERIGHT))
5465 {
5466 // MS-Windows console sends mouse scroll events encoded:
5467 // - CSI
5468 // - KS_EXTRA
5469 // - {KE_MOUSE[UP|DOWN|LEFT|RIGHT]}
5470 slen = 3;
5471 key_name[0] = tp[1];
5472 key_name[1] = tp[2];
5473 }
5474 else
5475 #endif
5459 { 5476 {
5460 int mouse_index_found = -1; 5477 int mouse_index_found = -1;
5461 5478
5462 for (idx = 0; idx < tc_len; ++idx) 5479 for (idx = 0; idx < tc_len; ++idx)
5463 { 5480 {