pub struct DispatchKeyEventParams<'a> { /* private fields */ }Expand description
Dispatches a key event to the page.
Implementations§
Source§impl<'a> DispatchKeyEventParams<'a>
impl<'a> DispatchKeyEventParams<'a>
Sourcepub fn builder(
type_: impl Into<Cow<'a, str>>,
) -> DispatchKeyEventParamsBuilder<'a>
pub fn builder( type_: impl Into<Cow<'a, str>>, ) -> DispatchKeyEventParamsBuilder<'a>
Creates a builder for this type with the required parameters:
type_: Type of the key event.
Sourcepub fn modifiers(&self) -> Option<i64>
pub fn modifiers(&self) -> Option<i64>
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
Sourcepub fn timestamp(&self) -> Option<&TimeSinceEpoch>
pub fn timestamp(&self) -> Option<&TimeSinceEpoch>
Time at which the event occurred.
Sourcepub fn text(&self) -> Option<&str>
pub fn text(&self) -> Option<&str>
Text as generated by processing a virtual key code with a keyboard layout. Not needed for for ‘keyUp’ and ‘rawKeyDown’ events (default: “”)
Sourcepub fn unmodified_text(&self) -> Option<&str>
pub fn unmodified_text(&self) -> Option<&str>
Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: “”).
Sourcepub fn key_identifier(&self) -> Option<&str>
pub fn key_identifier(&self) -> Option<&str>
Unique key identifier (e.g., ‘U+0041’) (default: “”).
Sourcepub fn code(&self) -> Option<&str>
pub fn code(&self) -> Option<&str>
Unique DOM defined string value for each physical key (e.g., ‘KeyA’) (default: “”).
Sourcepub fn key(&self) -> Option<&str>
pub fn key(&self) -> Option<&str>
Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., ‘AltGr’) (default: “”).
Sourcepub fn windows_virtual_key_code(&self) -> Option<i64>
pub fn windows_virtual_key_code(&self) -> Option<i64>
Windows virtual key code (default: 0).
Sourcepub fn native_virtual_key_code(&self) -> Option<i64>
pub fn native_virtual_key_code(&self) -> Option<i64>
Native virtual key code (default: 0).
Sourcepub fn auto_repeat(&self) -> Option<bool>
pub fn auto_repeat(&self) -> Option<bool>
Whether the event was generated from auto repeat (default: false).
Sourcepub fn is_keypad(&self) -> Option<bool>
pub fn is_keypad(&self) -> Option<bool>
Whether the event was generated from the keypad (default: false).
Sourcepub fn is_system_key(&self) -> Option<bool>
pub fn is_system_key(&self) -> Option<bool>
Whether the event was a system key event (default: false).
Sourcepub fn location(&self) -> Option<i64>
pub fn location(&self) -> Option<i64>
Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
Sourcepub fn commands(&self) -> Option<&[Cow<'a, str>]>
pub fn commands(&self) -> Option<&[Cow<'a, str>]>
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.
Trait Implementations§
Source§impl<'a> CdpCommand<'a> for DispatchKeyEventParams<'a>
impl<'a> CdpCommand<'a> for DispatchKeyEventParams<'a>
Source§impl<'a> Clone for DispatchKeyEventParams<'a>
impl<'a> Clone for DispatchKeyEventParams<'a>
Source§fn clone(&self) -> DispatchKeyEventParams<'a>
fn clone(&self) -> DispatchKeyEventParams<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more