mirror of
https://github.com/vim/vim.git
synced 2025-11-16 23:24:03 -05:00
patch 9.1.1907: xterm: no support for mouse buttons 8 and 9
Problem: xterm: no support for mouse buttons 8 and 9
Solution: Add support for terminals with xterm-like mouse functionality
(notuxic)
closes: #18719
Signed-off-by: notuxic <notuxic@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
efc3be77bb
commit
7dd51d3542
12
src/mouse.c
12
src/mouse.c
@@ -2316,6 +2316,10 @@ check_termcode_mouse(
|
||||
* 0x23 = any button release
|
||||
* 0x60 = button 4 down (scroll wheel down)
|
||||
* 0x61 = button 5 down (scroll wheel up)
|
||||
* 0x62 = button 6 down (scroll wheel left)
|
||||
* 0x63 = button 7 down (scroll wheel right)
|
||||
* 0xa0 = button 8 down (backward button)
|
||||
* 0xa1 = button 9 down (forward button)
|
||||
* add 0x04 for SHIFT
|
||||
* add 0x08 for ALT
|
||||
* add 0x10 for CTRL
|
||||
@@ -2470,7 +2474,7 @@ check_termcode_mouse(
|
||||
* Linux console with GPM and the MS-DOS or Win32 console
|
||||
* (multi-clicks use >= 0x60).
|
||||
*/
|
||||
if (mouse_code >= MOUSEWHEEL_LOW
|
||||
if (mouse_code >= MOUSEWHEEL_LOW && mouse_code < MOUSESIDEBUTTONS_LOW
|
||||
# ifdef FEAT_GUI
|
||||
&& !gui.in_use
|
||||
# endif
|
||||
@@ -2993,7 +2997,13 @@ check_termcode_mouse(
|
||||
held_button = MOUSE_RELEASE;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(UNIX)
|
||||
if (use_xterm_mouse() && orig_mouse_code >= MOUSESIDEBUTTONS_LOW)
|
||||
current_button = (current_button) ? MOUSE_X2 : MOUSE_X1;
|
||||
#endif
|
||||
key_name[1] = get_pseudo_mouse_code(current_button, is_click, is_drag);
|
||||
}
|
||||
|
||||
|
||||
// Make sure the mouse position is valid. Some terminals may return weird
|
||||
|
||||
Reference in New Issue
Block a user