Options
All
  • Public
  • Public/Protected
  • All
Menu

Keyboard provides an api for managing a virtual keyboard.

Hierarchy

  • Keyboard

Index

Methods

down

  • down(key: string, options?: { text?: string }): Promise<void>
  • Dispatches a keydown event.

    Parameters

    • key: string

      Name of key to press, such as ArrowLeft.

    • Optional options: { text?: string }

      Specifies a input text event.

      • Optional text?: string

    Returns Promise<void>

press

  • press(key: string, options?: { delay?: number; text?: string }): Promise<void>
  • Shortcut for keyboard.down and keyboard.up.

    Parameters

    • key: string
    • Optional options: { delay?: number; text?: string }
      • Optional delay?: number
      • Optional text?: string

    Returns Promise<void>

sendCharacter

  • sendCharacter(char: string): Promise<void>
  • Dispatches a keypress and input event. This does not send a keydown or keyup event.

    Parameters

    • char: string

    Returns Promise<void>

type

  • type(text: string, options?: { delay?: number }): Promise<void>
  • Sends a keydown, keypress/input, and keyup event for each character in the text.

    Parameters

    • text: string

      A text to type into a focused element.

    • Optional options: { delay?: number }

      Specifies the typing options.

      • Optional delay?: number

    Returns Promise<void>

up

  • up(key: string): Promise<void>
  • Dispatches a keyup event.

    Parameters

    • key: string

      Name of key to release, such as ArrowLeft.

    Returns Promise<void>

Generated using TypeDoc