Assistive-Webdriver

Home > assistive-playwright-client > VMKeyboard

VMKeyboard class

Object implementing the Keyboard interface from playwright, it can send low-level keyboard events to the virtual machine.

Signature:

export declare class VMKeyboard implements Keyboard 

Implements: Keyboard

Constructors

Constructor Modifiers Description
(constructor)(vm)   Creates a VMKeyboard object.

Properties

Property Modifiers Type Description
vm   VM Reference to the virtual machine

Methods

Method Modifiers Description
down(key)   Sends a low-level keydown event to the virtual machine.
insertText(text)   An alias of VMKeyboard.type(). In playwright, insertText differs from type by the fact that insertText only dispatches an input event and no keydown, keyup or keypress event. Here, as the goal is to use only low-level events, there is no distinction between insertText and type.
press(key, options)   Shortcut for VMKeyboard.down() and VMKeyboard.up().
type(text, options)   Sends a low-level keydown and keyup event for each character in the text.
up(key)   Sends a low-level keyup event to the virtual machine.