pub struct DispatchKeyEventParams {Show 15 fields
pub type_: String,
pub modifiers: Option<i64>,
pub timestamp: Option<TimeSinceEpoch>,
pub text: Option<String>,
pub unmodifiedText: Option<String>,
pub keyIdentifier: Option<String>,
pub code: Option<String>,
pub key: Option<String>,
pub windowsVirtualKeyCode: Option<i64>,
pub nativeVirtualKeyCode: Option<i64>,
pub autoRepeat: Option<bool>,
pub isKeypad: Option<bool>,
pub isSystemKey: Option<bool>,
pub location: Option<i64>,
pub commands: Option<Vec<String>>,
}Expand description
Dispatches a key event to the page.
Fields§
§type_: StringType of the key event.
modifiers: Option<i64>Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
timestamp: Option<TimeSinceEpoch>Time at which the event occurred.
text: Option<String>Text as generated by processing a virtual key code with a keyboard layout. Not needed for for ‘keyUp’ and ‘rawKeyDown’ events (default: “”)
unmodifiedText: Option<String>Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: “”).
keyIdentifier: Option<String>Unique key identifier (e.g., ‘U+0041’) (default: “”).
code: Option<String>Unique DOM defined string value for each physical key (e.g., ‘KeyA’) (default: “”).
key: Option<String>Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., ‘AltGr’) (default: “”).
windowsVirtualKeyCode: Option<i64>Windows virtual key code (default: 0).
nativeVirtualKeyCode: Option<i64>Native virtual key code (default: 0).
autoRepeat: Option<bool>Whether the event was generated from auto repeat (default: false).
isKeypad: Option<bool>Whether the event was generated from the keypad (default: false).
isSystemKey: Option<bool>Whether the event was a system key event (default: false).
location: Option<i64>Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
commands: Option<Vec<String>>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.
Implementations§
Trait Implementations§
Source§impl CdpCommand for DispatchKeyEventParams
impl CdpCommand for DispatchKeyEventParams
Source§impl Clone for DispatchKeyEventParams
impl Clone for DispatchKeyEventParams
Source§fn clone(&self) -> DispatchKeyEventParams
fn clone(&self) -> DispatchKeyEventParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more