Struct dioxus::prelude::keyboard_types::webdriver::KeyInputState
source · pub struct KeyInputState { /* private fields */ }
Available on crate feature
html
only.Expand description
Store pressed keys and modifiers.
Implementations§
source§impl KeyInputState
impl KeyInputState
sourcepub fn new() -> KeyInputState
pub fn new() -> KeyInputState
New state without any keys or modifiers pressed.
Same as the default value.
sourcepub fn dispatch_keydown(&mut self, raw_key: char) -> KeyboardEvent
pub fn dispatch_keydown(&mut self, raw_key: char) -> KeyboardEvent
Get a keyboard-keydown event from a WebDriver key value.
Stores that the key is pressed in the state object.
The input cancel list is not implemented here but can be emulated
by adding the raw_key
value with a keyUp
action to a list
before executing this function.
Specification: https://w3c.github.io/webdriver/#dfn-dispatch-a-keydown-action
sourcepub fn dispatch_keyup(&mut self, raw_key: char) -> Option<KeyboardEvent>
pub fn dispatch_keyup(&mut self, raw_key: char) -> Option<KeyboardEvent>
Get a keyboard-keyup event from a WebDriver key value.
Updates state. Returns None
if the key is not listed as pressed.
Specification: https://w3c.github.io/webdriver/#dfn-dispatch-a-keyup-action
Trait Implementations§
source§impl Clone for KeyInputState
impl Clone for KeyInputState
source§fn clone(&self) -> KeyInputState
fn clone(&self) -> KeyInputState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for KeyInputState
impl Debug for KeyInputState
source§impl Default for KeyInputState
impl Default for KeyInputState
source§fn default() -> KeyInputState
fn default() -> KeyInputState
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for KeyInputState
impl<'de> Deserialize<'de> for KeyInputState
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyInputState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyInputState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for KeyInputState
impl Serialize for KeyInputState
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for KeyInputState
impl RefUnwindSafe for KeyInputState
impl Send for KeyInputState
impl Sync for KeyInputState
impl Unpin for KeyInputState
impl UnwindSafe for KeyInputState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
source§impl<Cfg> TryIntoConfig for Cfg
impl<Cfg> TryIntoConfig for Cfg
source§fn into_config(self) -> Option<Cfg>
fn into_config(self) -> Option<Cfg>
Available on crate feature
launch
only.