Struct keyboard_types::webdriver::KeyInputState[][src]

pub struct KeyInputState { /* fields omitted */ }

Store pressed keys and modifiers.

Spec: https://w3c.github.io/webdriver/#dfn-key-input-state

Implementations

impl KeyInputState[src]

pub fn new() -> KeyInputState[src]

New state without any keys or modifiers pressed.

Same as the default value.

pub fn dispatch_keydown(&mut self, raw_key: char) -> KeyboardEvent[src]

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

pub fn dispatch_keyup(&mut self, raw_key: char) -> Option<KeyboardEvent>[src]

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

impl Clone for KeyInputState[src]

impl Debug for KeyInputState[src]

impl Default for KeyInputState[src]

impl<'de> Deserialize<'de> for KeyInputState[src]

impl Serialize for KeyInputState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.