KeyboardClass class provides methods to emulate keyboard input

Constructors

Properties

Methods

Constructors

Properties

config: KeyboardConfig = ...

Config object for KeyboardClass class

Methods

  • pressKey presses and holds a single Key for Key combinations Modifier Keys are to be given in "natural" ordering, so first modifier Keys, followed by the Key to press

    Parameters

    • Rest ...keys: Key[]

      Array of Keys to press and hold

    Returns Promise<KeyboardClass>

    Example

       // Will press and hold key combination STRG + V
    await keyboard.pressKey(Key.STRG, Key.V);
  • type types a sequence of String or single Keys via system keyboard

    Parameters

    • Rest ...input: StringOrKey

      Sequence of String or Key to type

    Returns Promise<KeyboardClass>

    Example

       await keyboard.type(Key.A, Key.S, Key.D, Key.F);
    await keyboard.type("Hello, world!");

Generated using TypeDoc