pub struct DispatchKeyEventBuilder { /* private fields */ }Expand description
Builder for DispatchKeyEvent.
Implementations§
Source§impl DispatchKeyEventBuilder
impl DispatchKeyEventBuilder
Sourcepub fn type<VALUE: Into<DispatchKeyEventTypeOption>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn type<VALUE: Into<DispatchKeyEventTypeOption>>( &mut self, value: VALUE, ) -> &mut Self
Type of the key event.
Sourcepub fn modifiers<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn modifiers<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
Sourcepub fn timestamp<VALUE: Into<TimeSinceEpoch>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn timestamp<VALUE: Into<TimeSinceEpoch>>( &mut self, value: VALUE, ) -> &mut Self
Time at which the event occurred.
Sourcepub fn text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut 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<VALUE: Into<String>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn unmodified_text<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut 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<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn key_identifier<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Unique key identifier (e.g., ‘U+0041’) (default: “”).
Sourcepub fn code<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn code<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Unique DOM defined string value for each physical key (e.g., ‘KeyA’) (default: “”).
Sourcepub fn key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut 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<VALUE: Into<JsUInt>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn windows_virtual_key_code<VALUE: Into<JsUInt>>( &mut self, value: VALUE, ) -> &mut Self
Windows virtual key code (default: 0).
Sourcepub fn native_virtual_key_code<VALUE: Into<JsUInt>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn native_virtual_key_code<VALUE: Into<JsUInt>>( &mut self, value: VALUE, ) -> &mut Self
Native virtual key code (default: 0).
Sourcepub fn auto_repeat<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn auto_repeat<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether the event was generated from auto repeat (default: false).
Sourcepub fn is_keypad<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn is_keypad<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether the event was generated from the keypad (default: false).
Sourcepub fn is_system_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn is_system_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether the event was a system key event (default: false).
Sourcepub fn location<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn location<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
Sourcepub fn commands<VALUE: Into<Vec<String>>>(&mut self, value: VALUE) -> &mut Self
pub fn commands<VALUE: Into<Vec<String>>>(&mut self, value: VALUE) -> &mut 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.
Sourcepub fn build(&self) -> Result<DispatchKeyEvent, DispatchKeyEventBuilderError>
pub fn build(&self) -> Result<DispatchKeyEvent, DispatchKeyEventBuilderError>
Trait Implementations§
Source§impl Clone for DispatchKeyEventBuilder
impl Clone for DispatchKeyEventBuilder
Source§fn clone(&self) -> DispatchKeyEventBuilder
fn clone(&self) -> DispatchKeyEventBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more