Click or drag to resize

InputClientDispatchKeyEventAsync Method

Version 109.1.110
Dispatches a key event to the page.

Namespace:  CefSharp.DevTools.Input
Assembly:  CefSharp (in CefSharp.dll) Version: 109.1.110.0 (109.1.110.0)
Syntax
public Task<DevToolsMethodResponse> DispatchKeyEventAsync(
	DispatchKeyEventType type,
	int? modifiers = null,
	double? timestamp = null,
	string text = null,
	string unmodifiedText = null,
	string keyIdentifier = null,
	string code = null,
	string key = null,
	int? windowsVirtualKeyCode = null,
	int? nativeVirtualKeyCode = null,
	bool? autoRepeat = null,
	bool? isKeypad = null,
	bool? isSystemKey = null,
	int? location = null,
	string[] commands = null
)

Parameters

type
Type: CefSharp.DevTools.InputDispatchKeyEventType
Type of the key event.
modifiers (Optional)
Type: SystemNullableInt32
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0).
timestamp (Optional)
Type: SystemNullableDouble
Time at which the event occurred.
text (Optional)
Type: SystemString
Text as generated by processing a virtual key code with a keyboard layout. Not needed forfor `keyUp` and `rawKeyDown` events (default: "")
unmodifiedText (Optional)
Type: SystemString
Text that would have been generated by the keyboard if no modifiers were pressed (except forshift). Useful for shortcut (accelerator) key handling (default: "").
keyIdentifier (Optional)
Type: SystemString
Unique key identifier (e.g., 'U+0041') (default: "").
code (Optional)
Type: SystemString
Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
key (Optional)
Type: SystemString
Unique DOM defined string value describing the meaning of the key in the context of activemodifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
windowsVirtualKeyCode (Optional)
Type: SystemNullableInt32
Windows virtual key code (default: 0).
nativeVirtualKeyCode (Optional)
Type: SystemNullableInt32
Native virtual key code (default: 0).
autoRepeat (Optional)
Type: SystemNullableBoolean
Whether the event was generated from auto repeat (default: false).
isKeypad (Optional)
Type: SystemNullableBoolean
Whether the event was generated from the keypad (default: false).
isSystemKey (Optional)
Type: SystemNullableBoolean
Whether the event was a system key event (default: false).
location (Optional)
Type: SystemNullableInt32
Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:0).
commands (Optional)
Type: SystemString
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.

Return Value

Type: TaskDevToolsMethodResponse
returns System.Threading.Tasks.Task<DevToolsMethodResponse>
See Also