pub struct DispatchKeyEventParamsBuilder<'a> { /* private fields */ }Implementations§
Source§impl<'a> DispatchKeyEventParamsBuilder<'a>
impl<'a> DispatchKeyEventParamsBuilder<'a>
Sourcepub fn modifiers(self, modifiers: i64) -> Self
pub fn modifiers(self, modifiers: i64) -> Self
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
Sourcepub fn timestamp(self, timestamp: TimeSinceEpoch) -> Self
pub fn timestamp(self, timestamp: TimeSinceEpoch) -> Self
Time at which the event occurred.
Sourcepub fn text(self, text: impl Into<Cow<'a, str>>) -> Self
pub fn text(self, text: impl Into<Cow<'a, str>>) -> Self
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, unmodified_text: impl Into<Cow<'a, str>>) -> Self
pub fn unmodified_text(self, unmodified_text: impl Into<Cow<'a, str>>) -> Self
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, key_identifier: impl Into<Cow<'a, str>>) -> Self
pub fn key_identifier(self, key_identifier: impl Into<Cow<'a, str>>) -> Self
Unique key identifier (e.g., ‘U+0041’) (default: “”).
Sourcepub fn code(self, code: impl Into<Cow<'a, str>>) -> Self
pub fn code(self, code: impl Into<Cow<'a, str>>) -> Self
Unique DOM defined string value for each physical key (e.g., ‘KeyA’) (default: “”).
Sourcepub fn key(self, key: impl Into<Cow<'a, str>>) -> Self
pub fn key(self, key: impl Into<Cow<'a, str>>) -> Self
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, windows_virtual_key_code: i64) -> Self
pub fn windows_virtual_key_code(self, windows_virtual_key_code: i64) -> Self
Windows virtual key code (default: 0).
Sourcepub fn native_virtual_key_code(self, native_virtual_key_code: i64) -> Self
pub fn native_virtual_key_code(self, native_virtual_key_code: i64) -> Self
Native virtual key code (default: 0).
Sourcepub fn auto_repeat(self, auto_repeat: bool) -> Self
pub fn auto_repeat(self, auto_repeat: bool) -> Self
Whether the event was generated from auto repeat (default: false).
Sourcepub fn is_keypad(self, is_keypad: bool) -> Self
pub fn is_keypad(self, is_keypad: bool) -> Self
Whether the event was generated from the keypad (default: false).
Sourcepub fn is_system_key(self, is_system_key: bool) -> Self
pub fn is_system_key(self, is_system_key: bool) -> Self
Whether the event was a system key event (default: false).
Sourcepub fn location(self, location: i64) -> Self
pub fn location(self, location: i64) -> Self
Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
Sourcepub fn commands(self, commands: Vec<Cow<'a, str>>) -> Self
pub fn commands(self, commands: Vec<Cow<'a, str>>) -> Self
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.