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/runtime/doc/gui.txt b/runtime/doc/gui.txt
index d4c24bf..84d6984 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -261,6 +261,7 @@
'mousefocus' window focus follows mouse pointer |gui-mouse-focus|
'mousemodel' what mouse button does which action
'mousehide' hide mouse pointer while typing text
+'mousemoveevent' enable mouse move events so that <MouseMove> can be mapped
'selectmode' whether to start Select mode or Visual mode
A quick way to set these is with the ":behave" command.
@@ -406,6 +407,9 @@
application, with shift-left mouse allowing for extending the visual area
rather than the right mouse button.
+<MouseMove> may be mapped, but 'mousemoveevent' must be enabled to use the
+mapping.
+
Mouse mapping with modifiers does not work for modeless selection.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index bdc2522..d5e5e68 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5517,6 +5517,18 @@
The 'mousemodel' option is set by the |:behave| command.
+ *'mousemoveevent'* *'mousemev'*
+'mousemoveevent' 'mousemev' boolean (default off)
+ global
+ {only works in the GUI}
+ When on, mouse move events are delivered to the input queue and are
+ available for mapping. The default, off, avoids the mouse movement
+ overhead except when needed. See |gui-mouse-mapping|.
+ Warning: Setting this option can make pending mappings to be aborted
+ when the mouse is moved.
+ Currently only works in the GUI, may be made to work in a terminal
+ later.
+
*'mouseshape'* *'mouses'* *E547*
'mouseshape' 'mouses' string (default "i-r:beam,s:updown,sd:udsizing,
vs:leftright,vd:lrsizing,m:no,
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 2a74883..1b726f7 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -131,8 +131,8 @@
forward: set to 1 for forward search.
"mouse":
- Inject a mouse button click event. The supported items in
- {args} are:
+ Inject either a mouse button click, or a mouse move, event.
+ The supported items in {args} are:
button: mouse button. The supported values are:
0 right mouse button
1 middle mouse button
@@ -151,6 +151,28 @@
4 shift is pressed
8 alt is pressed
16 ctrl is pressed
+ move: Optional; if used and TRUE then a mouse move
+ event can be generated.
+ Only {args} row: and col: are used and
+ required; they are interpreted as pixels.
+ Only results in an event when 'mousemoveevent'
+ is set or a popup uses mouse move events.
+
+ "scrollbar":
+ Set or drag the left, right or horizontal scrollbar. Only
+ works when the scrollbar actually exists. The supported
+ items in {args} are:
+ which: scrollbar. The supported values are:
+ left Left scrollbar of the current window
+ right Right scrollbar of the current window
+ hor Horizontal scrollbar
+ value: amount to scroll. For the vertical scrollbars
+ the value can be 1 to the line-count of the
+ buffer. For the horizontal scrollbar the
+ value can be between 1 and the maximum line
+ length, assuming 'wrap' is not set.
+ dragging: 1 to drag the scrollbar and 0 to click in the
+ scrollbar.
"scrollbar":
Set or drag the left, right or horizontal scrollbar. Only