patch 9.0.1112: test_mswin_event() can hang

Problem:    test_mswin_event() can hang.
Solution:   Add the "execute" argument to process events right away.
            (Christopher Plewright, closes #11760)
This commit is contained in:
Christopher Plewright
2022-12-30 16:54:58 +00:00
committed by Bram Moolenaar
parent 96dd34e534
commit 7b0afc1d76
6 changed files with 613 additions and 273 deletions

View File

@ -274,7 +274,7 @@ test_mswin_event({event}, {args}) *test_mswin_event()*
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.
keycode: Keycode to use for a keyup or a keydown event.
modifiers: Optional; key modifiers.
The supported values are:
2 shift is pressed
@ -282,9 +282,14 @@ test_mswin_event({event}, {args}) *test_mswin_event()*
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.
execute: Optional. Similar to |feedkeys()| mode x.
When this is included and set to true
(non-zero) then Vim will process any buffered
unprocessed key events. All other {args}
items are optional when this is set and true.
Returns TRUE if the event is successfully added or executed,
FALSE if there is a failure.
Can also be used as a |method|: >
GetEvent()->test_mswin_event({args})