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) -> KeyOutput
pub const fn from_usage(key_usage: KeyUsage) -> KeyOutput
Constructs a KeyOutput from a key usage.
Sourcepub const fn from_usage_with_modifiers(
key_usage: KeyUsage,
key_modifiers: KeyboardModifiers,
) -> KeyOutput
pub const fn from_usage_with_modifiers( key_usage: KeyUsage, key_modifiers: KeyboardModifiers, ) -> KeyOutput
Constructs a KeyOutput from a key usage.
Sourcepub const fn from_key_code(key_code: u8) -> KeyOutput
pub const fn from_key_code(key_code: u8) -> KeyOutput
Constructs a KeyOutput from a key code.
Sourcepub const fn from_key_code_with_modifiers(
key_code: u8,
key_modifiers: KeyboardModifiers,
) -> KeyOutput
pub const fn from_key_code_with_modifiers( key_code: u8, key_modifiers: KeyboardModifiers, ) -> KeyOutput
Constructs a KeyOutput from a key code with the given keyboard modifiers.
Sourcepub const fn from_key_modifiers(key_modifiers: KeyboardModifiers) -> KeyOutput
pub const fn from_key_modifiers(key_modifiers: KeyboardModifiers) -> KeyOutput
Constructs a KeyOutput for just the given keyboard modifiers.
Sourcepub const fn from_consumer_code(usage_code: u8) -> KeyOutput
pub const fn from_consumer_code(usage_code: u8) -> KeyOutput
Constructs a KeyOutput from a consumer code.
Sourcepub const fn from_custom_code(custom_code: u8) -> KeyOutput
pub const fn from_custom_code(custom_code: u8) -> KeyOutput
Constructs a KeyOutput from a custom code.
Sourcepub const fn from_mouse_output(mouse_output: MouseOutput) -> KeyOutput
pub const fn from_mouse_output(mouse_output: MouseOutput) -> KeyOutput
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.
Sourcepub const fn without_modifiers(self, suppress: KeyboardModifiers) -> KeyOutput
pub const fn without_modifiers(self, suppress: KeyboardModifiers) -> KeyOutput
Returns a copy with the given modifier bits cleared.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyOutput
impl<'de> Deserialize<'de> for KeyOutput
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for KeyOutput
impl Serialize for KeyOutput
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
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 UnsafeUnpin 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