Table of Contents

Class DispatchKeyEventCommandSettings

Namespace
OpenQA.Selenium.DevTools.V146.Input
Assembly
Selenium.WebDriver.dll

Dispatches a key event to the page.

public sealed class DispatchKeyEventCommandSettings : ICommand
Inheritance
DispatchKeyEventCommandSettings
Implements
Inherited Members

Properties

AutoRepeat

Whether the event was generated from auto repeat (default: false).

[JsonPropertyName("autoRepeat")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? AutoRepeat { get; set; }

Property Value

bool?

Code

Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").

[JsonPropertyName("code")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? Code { get; set; }

Property Value

string

CommandName

Gets the name of the command.

[JsonIgnore]
public string CommandName { get; }

Property Value

string

Commands

Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in document.execCommand and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.

[JsonPropertyName("commands")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string[]? Commands { get; set; }

Property Value

string[]

IsKeypad

Whether the event was generated from the keypad (default: false).

[JsonPropertyName("isKeypad")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? IsKeypad { get; set; }

Property Value

bool?

IsSystemKey

Whether the event was a system key event (default: false).

[JsonPropertyName("isSystemKey")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? IsSystemKey { get; set; }

Property Value

bool?

Key

Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").

[JsonPropertyName("key")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? Key { get; set; }

Property Value

string

KeyIdentifier

Unique key identifier (e.g., 'U+0041') (default: "").

[JsonPropertyName("keyIdentifier")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? KeyIdentifier { get; set; }

Property Value

string

Location

Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).

[JsonPropertyName("location")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? Location { get; set; }

Property Value

long?

Modifiers

Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

[JsonPropertyName("modifiers")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? Modifiers { get; set; }

Property Value

long?

NativeVirtualKeyCode

Native virtual key code (default: 0).

[JsonPropertyName("nativeVirtualKeyCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? NativeVirtualKeyCode { get; set; }

Property Value

long?

Text

Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")

[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? Text { get; set; }

Property Value

string

Timestamp

Time at which the event occurred.

[JsonPropertyName("timestamp")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public double? Timestamp { get; set; }

Property Value

double?

Type

Type of the key event.

[JsonPropertyName("type")]
public string Type { get; set; }

Property Value

string

UnmodifiedText

Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").

[JsonPropertyName("unmodifiedText")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? UnmodifiedText { get; set; }

Property Value

string

WindowsVirtualKeyCode

Windows virtual key code (default: 0).

[JsonPropertyName("windowsVirtualKeyCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? WindowsVirtualKeyCode { get; set; }

Property Value

long?