Skip to main content
Module

x/denops_std/function/vim/mod.ts>test_mswin_event

📚 Standard module for denops.vim
Go to Latest
function test_mswin_event
import { test_mswin_event } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

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. 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})

Parameters

denops: Denops
event: unknown
args: unknown

Returns

Promise<boolean>