comparison src/mouse.c @ 29591:eb07470d0395 v9.0.0136

patch 9.0.0136: after CTRL-Left-mouse click a mouse scroll also has CTRL Commit: https://github.com/vim/vim/commit/d6212b80d6d49d4d890c3141b7c6b83f899333b0 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 3 15:48:33 2022 +0100 patch 9.0.0136: after CTRL-Left-mouse click a mouse scroll also has CTRL Problem: After CTRL-Left-mouse click a mouse scroll also has CTRL. Solution: Reset orig_mouse_code also for wheel events. (closes https://github.com/vim/vim/issues/10840)
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Aug 2022 17:00:06 +0200
parents 057c26b5c33a
children b11130c6e694
comparison
equal deleted inserted replaced
29590:d161a4dba51e 29591:eb07470d0395
2401 || mouse_code == 0x40 || mouse_code == 0x41)) 2401 || mouse_code == 0x40 || mouse_code == 0x41))
2402 { 2402 {
2403 // Apparently 0x23 and 0x24 are used by rxvt scroll wheel. 2403 // Apparently 0x23 and 0x24 are used by rxvt scroll wheel.
2404 // And 0x40 and 0x41 are used by some xterm emulator. 2404 // And 0x40 and 0x41 are used by some xterm emulator.
2405 wheel_code = mouse_code - (mouse_code >= 0x40 ? 0x40 : 0x23) 2405 wheel_code = mouse_code - (mouse_code >= 0x40 ? 0x40 : 0x23)
2406 + MOUSEWHEEL_LOW; 2406 + MOUSEWHEEL_LOW;
2407 } 2407 }
2408 # endif 2408 # endif
2409 2409
2410 # if defined(UNIX) 2410 # if defined(UNIX)
2411 else if (use_xterm_mouse() > 1) 2411 else if (use_xterm_mouse() > 1)
2786 */ 2786 */
2787 if ((mouse_code & MOUSE_DRAG) == MOUSE_DRAG) 2787 if ((mouse_code & MOUSE_DRAG) == MOUSE_DRAG)
2788 is_drag = TRUE; 2788 is_drag = TRUE;
2789 current_button = held_button; 2789 current_button = held_button;
2790 } 2790 }
2791 else if (wheel_code == 0) 2791 else
2792 { 2792 {
2793 if (wheel_code == 0)
2794 {
2793 # ifdef CHECK_DOUBLE_CLICK 2795 # ifdef CHECK_DOUBLE_CLICK
2794 # ifdef FEAT_MOUSE_GPM 2796 # ifdef FEAT_MOUSE_GPM
2795 /* 2797 /*
2796 * Only for Unix, when GUI not active, we handle multi-clicks here, but 2798 * Only for Unix, when GUI not active, we handle multi-clicks here, but
2797 * not for GPM mouse events. 2799 * not for GPM mouse events.
2847 # endif 2849 # endif
2848 # else 2850 # else
2849 orig_num_clicks = NUM_MOUSE_CLICKS(mouse_code); 2851 orig_num_clicks = NUM_MOUSE_CLICKS(mouse_code);
2850 # endif 2852 # endif
2851 is_click = TRUE; 2853 is_click = TRUE;
2852 orig_mouse_code = mouse_code; 2854 }
2855 orig_mouse_code = mouse_code;
2853 } 2856 }
2854 if (!is_drag) 2857 if (!is_drag)
2855 held_button = mouse_code & MOUSE_CLICK_MASK; 2858 held_button = mouse_code & MOUSE_CLICK_MASK;
2856 2859
2857 /* 2860 /*