summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorChristopher Plewright <chris@createng.com>2022-12-20 20:01:58 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-20 20:01:58 +0000
commit20b795e0eba6c933868c8f7cf62fb85d4f007688 (patch)
treeac278d8ec958a58ba6c5a90fba8aef7270abc72f /runtime/doc
parent418b54788106efd94bbc71a4b100afae1080cbfc (diff)
patch 9.0.1084: code handling low level MS-Windows events cannot be testedv9.0.1084
Problem: Code handling low level MS-Windows events cannot be tested. Solution: Add test_mswin_event() and tests using it. (Christopher Plewright, closes #11622)
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/testing.txt72
-rw-r--r--runtime/doc/usr_41.txt1
3 files changed, 72 insertions, 3 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 7ff969d7cb..05e8d701f8 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -666,6 +666,8 @@ test_garbagecollect_soon() none free memory soon for testing
test_getvalue({string}) any get value of an internal variable
test_gui_event({event}, {args}) bool generate a GUI event for testing
test_ignore_error({expr}) none ignore a specific error
+test_mswin_event({event}, {args})
+ bool generate MS-Windows event for testing
test_null_blob() Blob null value for testing
test_null_channel() Channel null value for testing
test_null_dict() Dict null value for testing
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 558553f5ac..b03726572b 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -94,7 +94,7 @@ test_gui_event({event}, {args})
"findrepl" search and replace text.
"mouse" mouse button click event.
"scrollbar" move or drag the scrollbar.
- "sendevent" send a low-level GUI event.
+ "key" send a low-level keyboard event.
"tabline" select a tab page by mouse click.
"tabmenu" select a tabline menu entry.
@@ -178,8 +178,8 @@ test_gui_event({event}, {args})
dragging: 1 to drag the scrollbar and 0 to click in the
scrollbar.
- "sendevent":
- Send a low-level GUI event (e.g. key-up or down).
+ "key":
+ Send a low-level keyboard event (e.g. key-up or down).
Currently only supported on MS-Windows.
The supported items in {args} are:
event: The supported string values are:
@@ -223,6 +223,72 @@ test_ignore_error({expr}) *test_ignore_error()*
Can also be used as a |method|: >
GetErrorText()->test_ignore_error()
+
+test_mswin_event({event}, {args}) *test_mswin_event()*
+ Generate a low-level MS-Windows {event} with arguments {args}
+ for testing Vim functionality. It works for MS-Windows GUI
+ and for the console.
+
+ {event} is a String and the supported values are:
+ "mouse" mouse event.
+ "key" keyboard event.
+
+ "mouse":
+ 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
+ 2 left mouse button
+ 3 mouse button release
+ 4 scroll wheel down
+ 5 scroll wheel up
+ 6 scroll wheel left
+ 7 scroll wheel right
+ row: mouse click row number. The first row of the
+ Vim window is 1 and the last row is 'lines'.
+ col: mouse click column number. The maximum value
+ of {col} is 'columns'.
+ Note: row and col are always interpreted as
+ screen cells for the console application.
+ But, they may be interpreted as pixels
+ for the GUI, depending on "cell".
+ multiclick: set to 1 to inject a double-click mouse event.
+ modifiers: key modifiers. The supported values are:
+ 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.
+ Only results in an event when 'mousemoveevent'
+ is set or a popup uses mouse move events.
+ cell: Optional for the GUI: when present and TRUE
+ then "move" uses screen cells instead of pixel
+ positions. Not used by the console.
+
+ "key":
+ Send a low-level keyboard event (e.g. keyup or keydown).
+ The supported items in {args} are:
+ event: The supported string values are:
+ keyup generate a keyup event
+ keydown generate a keydown event
+ keycode: Keycode to use for a keyup or a keydown event.
+ modifiers: Optional; key modifiers.
+ The supported values are:
+ 2 shift is pressed
+ 4 ctrl is pressed
+ 8 alt is pressed
+ Note: These values are different from the
+ mouse modifiers.
+ *E1291*
+ Returns TRUE if the event is successfully added, FALSE if
+ there is a failure.
+
+ Can also be used as a |method|: >
+ GetEvent()->test_mswin_event({args})
+<
test_null_blob() *test_null_blob()*
Return a |Blob| that is null. Only useful for testing.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index aa51fe3e96..c67bd99ef2 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1186,6 +1186,7 @@ Testing: *test-functions*
test_getvalue() get value of an internal variable
test_gui_event() generate a GUI event for testing
test_ignore_error() ignore a specific error message
+ test_mswin_event() generate an MS-Windows event
test_null_blob() return a null Blob
test_null_channel() return a null Channel
test_null_dict() return a null Dict