patch 8.2.4674: cannot force getting MouseMove events
Problem: Cannot force getting MouseMove events.
Solution: Add the 'mousemoveevent' option with implementaiton for the GUI.
(Ernie Rael, closes #10044)
diff --git a/src/testing.c b/src/testing.c
index 48ba14d..c053487 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -1368,22 +1368,35 @@
int col;
int repeated_click;
int_u mods;
+ int move;
- if (dict_find(args, (char_u *)"button", -1) == NULL
- || dict_find(args, (char_u *)"row", -1) == NULL
- || dict_find(args, (char_u *)"col", -1) == NULL
- || dict_find(args, (char_u *)"multiclick", -1) == NULL
- || dict_find(args, (char_u *)"modifiers", -1) == NULL)
+ if (dict_find(args, (char_u *)"row", -1) == NULL
+ || dict_find(args, (char_u *)"col", -1) == NULL)
return FALSE;
- button = (int)dict_get_number(args, (char_u *)"button");
+ // Note: "move" is optional, requires fewer arguments
+ move = (int)dict_get_bool(args, (char_u *)"move", FALSE);
+
+ if (!move && (dict_find(args, (char_u *)"button", -1) == NULL
+ || dict_find(args, (char_u *)"multiclick", -1) == NULL
+ || dict_find(args, (char_u *)"modifiers", -1) == NULL))
+ return FALSE;
+
row = (int)dict_get_number(args, (char_u *)"row");
col = (int)dict_get_number(args, (char_u *)"col");
- repeated_click = (int)dict_get_number(args, (char_u *)"multiclick");
- mods = (int)dict_get_number(args, (char_u *)"modifiers");
- gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1),
+ if (move)
+ gui_mouse_moved(col, row);
+ else
+ {
+ button = (int)dict_get_number(args, (char_u *)"button");
+ repeated_click = (int)dict_get_number(args, (char_u *)"multiclick");
+ mods = (int)dict_get_number(args, (char_u *)"modifiers");
+
+ gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1),
repeated_click, mods);
+ }
+
return TRUE;
}