pub struct KeyOutput { /* private fields */ }
Expand description
Struct for the output from KeyState.
Implementations§
Source§impl KeyOutput
impl KeyOutput
Sourcepub const fn from_usage(key_usage: KeyUsage) -> Self
pub const fn from_usage(key_usage: KeyUsage) -> Self
Constructs a KeyOutput from a key usage.
Sourcepub const fn from_usage_with_modifiers(
key_usage: KeyUsage,
key_modifiers: KeyboardModifiers,
) -> Self
pub const fn from_usage_with_modifiers( key_usage: KeyUsage, key_modifiers: KeyboardModifiers, ) -> Self
Constructs a KeyOutput from a key usage.
Sourcepub const fn from_key_code(key_code: u8) -> Self
pub const fn from_key_code(key_code: u8) -> Self
Constructs a KeyOutput from a key code.
Sourcepub const fn from_key_code_with_modifiers(
key_code: u8,
key_modifiers: KeyboardModifiers,
) -> Self
pub const fn from_key_code_with_modifiers( key_code: u8, key_modifiers: KeyboardModifiers, ) -> Self
Constructs a KeyOutput from a key code with the given keyboard modifiers.
Sourcepub const fn from_key_modifiers(key_modifiers: KeyboardModifiers) -> Self
pub const fn from_key_modifiers(key_modifiers: KeyboardModifiers) -> Self
Constructs a KeyOutput for just the given keyboard modifiers.
Sourcepub const fn from_consumer_code(usage_code: u8) -> Self
pub const fn from_consumer_code(usage_code: u8) -> Self
Constructs a KeyOutput from a consumer code.
Sourcepub const fn from_custom_code(custom_code: u8) -> Self
pub const fn from_custom_code(custom_code: u8) -> Self
Constructs a KeyOutput from a custom code.
Sourcepub const fn from_mouse_output(mouse_output: MouseOutput) -> Self
pub const fn from_mouse_output(mouse_output: MouseOutput) -> Self
Constructs a KeyOutput from a mouse output.
Sourcepub const fn key_modifiers(&self) -> KeyboardModifiers
pub const fn key_modifiers(&self) -> KeyboardModifiers
Returns the keyboard modifiers of the key output.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyOutput
impl<'de> Deserialize<'de> for KeyOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for KeyOutput
impl Eq for KeyOutput
impl StructuralPartialEq for KeyOutput
Auto Trait Implementations§
impl Freeze for KeyOutput
impl RefUnwindSafe for KeyOutput
impl Send for KeyOutput
impl Sync for KeyOutput
impl Unpin for KeyOutput
impl UnwindSafe for KeyOutput
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