Support extra side mouse buttons in MacVim (X1 and X2)

This commit is contained in:
Yee Cheng Chin
2025-01-25 17:04:34 -08:00
parent 8a68481be9
commit bd913cea83
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1166,7 +1166,7 @@ Mouse clicks can be mapped. The codes for mouse clicks are:
The X1 and X2 buttons refer to the extra buttons found on some mice. The
'Microsoft Explorer' mouse has these buttons available to the right thumb.
Currently X1 and X2 only work on Win32 and X11 environments.
Currently X1 and X2 only work on MacVim, Win32, and X11 environments.
Examples: >
:noremap <MiddleMouse> <LeftMouse><MiddleMouse>
+2 -2
View File
@@ -3793,9 +3793,9 @@ static unsigned eventModifierFlagsToVimMouseModMask(unsigned modifierFlags)
static int eventButtonNumberToVimMouseButton(int buttonNumber)
{
static int mouseButton[] = { MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE };
static int mouseButton[] = { MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE, MOUSE_X1, MOUSE_X2 };
return (buttonNumber >= 0 && buttonNumber < 3)
return (buttonNumber >= 0 && buttonNumber < 5)
? mouseButton[buttonNumber] : -1;
}