pub struct KeyCombo {
pub modifiers: u8,
pub key_code: u16,
pub display: String,
}Expand description
A modifier + virtual-key keystroke captured by the P1.3 recorder UI or
hand-authored in config.toml.
modifiers is a bitmask of KeyCombo::MOD_CMD etc. so the wire format
is a compact integer, not a string. key_code is the macOS virtual key
(kVK_*); other platforms map at execute time when they grow real
support.
display is purely for rendering — e.g. "⌘⇧P". Callers regenerate it
from the captured chord; we keep it in the struct so older configs
continue to render the same label without re-deriving on every load.
Fields§
§modifiers: u8Bitmask of Self::MOD_CMD etc.
key_code: u16macOS virtual key code (kVK_*). 0 means “no key” — useful for
modifier-only placeholders that the recorder UI rejects.
display: StringPre-rendered chord label, e.g. "⌘⇧P". Empty falls through to a
generated label at runtime.
Implementations§
Source§impl KeyCombo
impl KeyCombo
pub const MOD_CMD: u8
pub const MOD_SHIFT: u8
pub const MOD_CTRL: u8
pub const MOD_OPTION: u8
Sourcepub fn rendered_label(&self) -> String
pub fn rendered_label(&self) -> String
Build the human-readable label from the modifier bitmask + key code.
Falls back to "⌘key 0xNN" when the key code isn’t one of the
commonly-recognised letters; the recorder UI usually overrides this
with its own derivation.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.