Options
All
  • Public
  • Public/Protected
  • All
Menu

KeyboardClass class provides methods to emulate keyboard input

Hierarchy

  • KeyboardClass

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

config

config: { autoDelayMs: number } = ...

Config object for KeyboardClass class

Type declaration

  • autoDelayMs: number

Methods

pressKey

  • 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

    example
       // Will press and hold key combination STRG + V
       await keyboard.pressKey(Key.STRG, Key.V);
    

    Parameters

    • Rest ...keys: Key[]

      Array of Keys to press and hold

    Returns Promise<KeyboardClass>

releaseKey

  • pressKey releases 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

    example
       // Will release key combination STRG + V
       await keyboard.releaseKey(Key.STRG, Key.V);
    

    Parameters

    • Rest ...keys: Key[]

      Array of Keys to release

    Returns Promise<KeyboardClass>

type

  • type types a sequence of {@link String} or single Keys via system keyboard

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

    Parameters

    • Rest ...input: StringOrKey

      Sequence of {@link String} or Key to type

    Returns Promise<KeyboardClass>