aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-12-18 21:47:06 +0100
committerGitHub <noreply@github.com>2023-12-18 21:47:06 +0100
commit80f75d063d2fd2fabf0584a0167920af647f6e9e (patch)
tree6ee0350184b6e5c60a94e4df8c8c3c14316086e4 /src/nvim/api/vim.c
parent3a4aa3fc58f87a295a075fe457bc78805eef7c4d (diff)
parent428edcde7068ab44040e19b43343741e5ca59770 (diff)
downloadrneovim-80f75d063d2fd2fabf0584a0167920af647f6e9e.tar.gz
rneovim-80f75d063d2fd2fabf0584a0167920af647f6e9e.tar.bz2
rneovim-80f75d063d2fd2fabf0584a0167920af647f6e9e.zip
Merge pull request #26279 from agraven/x1-x2-mouse-api
feat(api): add forward and back mouse buttons
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c7
1 files changed, 6 insertions, 1 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 {