Table of Contents

Class KeyInputDevice

Namespace
OpenQA.Selenium.Interactions
Assembly
WebDriver.dll

Represents a key input device, such as a keyboard.

public class KeyInputDevice : InputDevice
Inheritance
KeyInputDevice
Inherited Members

Constructors

KeyInputDevice()

Initializes a new instance of the KeyInputDevice class.

public KeyInputDevice()

KeyInputDevice(string)

Initializes a new instance of the KeyInputDevice class, given the device's name.

public KeyInputDevice(string deviceName)

Parameters

deviceName string

The unique name of this input device.

Properties

DeviceKind

Gets the type of device for this input device.

public override InputDeviceKind DeviceKind { get; }

Property Value

InputDeviceKind

Methods

CreateKeyDown(char)

Creates a key-down action for simulating a press of a key.

public Interaction CreateKeyDown(char codePoint)

Parameters

codePoint char

The unicode character to be sent.

Returns

Interaction

The Interaction representing the action.

CreateKeyUp(char)

Creates a key-up action for simulating a release of a key.

public Interaction CreateKeyUp(char codePoint)

Parameters

codePoint char

The unicode character to be sent.

Returns

Interaction

The Interaction representing the action.

ToDictionary()

Converts this input device into an object suitable for serializing across the wire.

public override Dictionary<string, object> ToDictionary()

Returns

Dictionary<string, object>

A Dictionary<TKey, TValue> representing this input device.