Function press

  • Simulates pressing a key, or a combination of keys.

    Parameters

    • ctx: Context

      Context object

    • keys: KeyInput[]

      Name of key to press, such as ArrowLeft. KeyInput for a list of all key names.

    • Optional options: PressKeyOptions

      Options for key press and pupeeteer keyboard press: interval, times, delay, text.

    Returns Promise<void>

    Example

    await press(ctx, [key, ...modifiers], options);
    

    Example

    await press(ctx, ['a','Control']); // Select all
    

    Example

    await press(ctx, ['Backspace'], {timeBetweenPresses: 100, times: 5, pressDuration: 200});
    

Generated using TypeDoc