pub struct KeyCombo { /* private fields */ }Expand description
A platform-neutral keyboard chord.
Human-readable formats store the canonical text chord; binary IPC stores validated modifier bits and a USB HID usage.
Implementations§
Source§impl KeyCombo
impl KeyCombo
Sourcepub const fn key(&self) -> KeyboardUsage
pub const fn key(&self) -> KeyboardUsage
USB HID keyboard usage for the ordinary key.
Sourcepub const fn has_command(&self) -> bool
pub const fn has_command(&self) -> bool
Whether the chord includes Command, the cross-platform primary modifier: Command on macOS, Control on Linux and Windows.
Sourcepub const fn has_control(&self) -> bool
pub const fn has_control(&self) -> bool
Whether the chord includes Control.
Sourcepub const fn has_option(&self) -> bool
pub const fn has_option(&self) -> bool
Whether the chord includes Option/Alt.
Sourcepub const fn has_super(&self) -> bool
pub const fn has_super(&self) -> bool
Whether the chord includes the logo key, written Super, Win, or
Meta: Command on macOS, the Windows key, KEY_LEFTMETA on Linux.
Unlike Self::has_command, it never becomes Control.
Sourcepub fn rendered_label(&self) -> String
pub fn rendered_label(&self) -> String
Canonical user-facing chord label.
Sourcepub fn rendered_modifiers(&self) -> Option<String>
pub fn rendered_modifiers(&self) -> Option<String>
Canonical label for the chord’s modifiers alone, or None when it
carries none. An action that holds the modifiers while tapping the
ordinary key separately labels the two halves separately too.
Sourcepub fn rendered_key(&self) -> String
pub fn rendered_key(&self) -> String
Canonical label for the chord’s ordinary key alone.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyCombo
impl<'de> Deserialize<'de> for KeyCombo
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>,
impl Eq for KeyCombo
impl StructuralPartialEq for KeyCombo
Auto Trait Implementations§
impl Freeze for KeyCombo
impl RefUnwindSafe for KeyCombo
impl Send for KeyCombo
impl Sync for KeyCombo
impl Unpin for KeyCombo
impl UnsafeUnpin for KeyCombo
impl UnwindSafe for KeyCombo
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.