aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/vim.c7
-rw-r--r--src/nvim/os/input.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 70e6b840de..aed286165a 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -345,7 +345,8 @@ Integer nvim_input(String keys)
/// mouse input in a GUI. The deprecated pseudokey form
/// ("<LeftMouse><col,row>") of |nvim_input()| has the same limitation.
///
-/// @param button Mouse button: one of "left", "right", "middle", "wheel", "move".
+/// @param button Mouse button: one of "left", "right", "middle", "wheel", "move",
+/// "x1", "x2".
/// @param action For ordinary buttons, one of "press", "drag", "release".
/// For the wheel, one of "up", "down", "left", "right". Ignored for "move".
/// @param modifier String of modifiers each represented by a single char.
@@ -376,6 +377,10 @@ void nvim_input_mouse(String button, String action, String modifier, Integer gri
code = KE_RIGHTMOUSE;
} else if (strequal(button.data, "wheel")) {
code = KE_MOUSEDOWN;
+ } else if (strequal(button.data, "x1")) {
+ code = KE_X1MOUSE;
+ } else if (strequal(button.data, "x2")) {
+ code = KE_X2MOUSE;
} else if (strequal(button.data, "move")) {
code = KE_MOUSEMOVE;
} else {
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 5b759e9d1e..ed4267dcbb 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -311,7 +311,8 @@ static uint8_t check_multiclick(int code, int grid, int row, int col)
}
// For click events the number of clicks is updated.
- if (code == KE_LEFTMOUSE || code == KE_RIGHTMOUSE || code == KE_MIDDLEMOUSE) {
+ if (code == KE_LEFTMOUSE || code == KE_RIGHTMOUSE || code == KE_MIDDLEMOUSE
+ || code == KE_X1MOUSE || code == KE_X2MOUSE) {
uint64_t mouse_time = os_hrtime(); // time of current mouse click (ns)
// compute the time elapsed since the previous mouse click and
// convert p_mouse from ms to ns