InputClientDispatchKeyEventAsync Method |
Version 90.6.50
Dispatches a key event to the page.
Namespace:
CefSharp.DevTools.Input
Assembly:
CefSharp (in CefSharp.dll) Version: 90.6.50.0 (90.6.50.0)
Syntax public Task<DevToolsMethodResponse> DispatchKeyEventAsync(
string type,
Nullable<int> modifiers = null,
Nullable<long> timestamp = null,
string text = null,
string unmodifiedText = null,
string keyIdentifier = null,
string code = null,
string key = null,
Nullable<int> windowsVirtualKeyCode = null,
Nullable<int> nativeVirtualKeyCode = null,
Nullable<bool> autoRepeat = null,
Nullable<bool> isKeypad = null,
Nullable<bool> isSystemKey = null,
Nullable<int> location = null,
string[] commands = null
)
public:
Task<DevToolsMethodResponse^>^ DispatchKeyEventAsync(
String^ type,
Nullable<int> modifiers = nullptr,
Nullable<long long> timestamp = nullptr,
String^ text = nullptr,
String^ unmodifiedText = nullptr,
String^ keyIdentifier = nullptr,
String^ code = nullptr,
String^ key = nullptr,
Nullable<int> windowsVirtualKeyCode = nullptr,
Nullable<int> nativeVirtualKeyCode = nullptr,
Nullable<bool> autoRepeat = nullptr,
Nullable<bool> isKeypad = nullptr,
Nullable<bool> isSystemKey = nullptr,
Nullable<int> location = nullptr,
array<String^>^ commands = nullptr
)
Parameters
- type
- Type: SystemString
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: SystemNullableInt64
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/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
Return Value
Type:
TaskDevToolsMethodResponsereturns System.Threading.Tasks.Task<DevToolsMethodResponse>
See Also