KeyEventCreationInfo

Struct KeyEventCreationInfo 

Source
pub struct KeyEventCreationInfo<'a, 'b> {
    pub ty: KeyEventType,
    pub modifiers: KeyEventModifiers,
    pub virtual_key_code: VirtualKeyCode,
    pub native_key_code: i32,
    pub text: &'a str,
    pub unmodified_text: &'b str,
    pub is_keypad: bool,
    pub is_auto_repeat: bool,
    pub is_system_key: bool,
}
Expand description

Wrapper around all arguments needed to create a KeyEvent.

Fields§

§ty: KeyEventType

The type of the event.

§modifiers: KeyEventModifiers

The modifiers that were pressed with the key.

§virtual_key_code: VirtualKeyCode

The virtual key-code associated with this keyboard event. This is either directly from the event (ie, WPARAM on Windows) or via a mapping function.

§native_key_code: i32

The actual key-code generated by the platform. The DOM spec primarily uses Windows-equivalent codes (hence virtual_key_code above) but it helps to also specify the platform-specific key-code as well.

§text: &'a str

The actual text generated by this keyboard event. This is usually only a single character.

§unmodified_text: &'b str

The text generated by this keyboard event before all modifiers except shift are applied. This is used internally for working out shortcut keys. This is usually only a single character.

§is_keypad: bool

Whether or not this is a keypad event.

§is_auto_repeat: bool

Whether or not this was generated as the result of an auto-repeat (eg, holding down a key)

§is_system_key: bool

Whether or not the pressed key is a “system key”. This is a Windows-only concept and should be “false” for all non-Windows platforms. For more information, see the following link: http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for KeyEventCreationInfo<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for KeyEventCreationInfo<'a, 'b>

§

impl<'a, 'b> Send for KeyEventCreationInfo<'a, 'b>

§

impl<'a, 'b> Sync for KeyEventCreationInfo<'a, 'b>

§

impl<'a, 'b> Unpin for KeyEventCreationInfo<'a, 'b>

§

impl<'a, 'b> UnwindSafe for KeyEventCreationInfo<'a, 'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.