pub struct KeyTrigger {
pub keycode: u16,
pub modifiers: KeyModifiers,
}Expand description
A keyboard trigger: a keycode plus an optional modifier mask. The parse
format is [mod+]+key, e.g. "f1", "shift+cmd+f5". Modifier names:
shift, control (alias ctrl), option (alias alt), command
(alias cmd). Key names: esc, f1..f19 (macOS virtual keycodes).
Serializes as its string form (via Display) so it can be a TOML map key:
[keyboard.bindings] keys are "f1", "shift+f2", etc.
Fields§
§keycode: u16Platform virtual keycode (macOS kVK_*).
modifiers: KeyModifiersModifier mask that must also be held.
Trait Implementations§
Source§impl Clone for KeyTrigger
impl Clone for KeyTrigger
Source§fn clone(&self) -> KeyTrigger
fn clone(&self) -> KeyTrigger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyTrigger
impl Debug for KeyTrigger
Source§impl<'de> Deserialize<'de> for KeyTrigger
impl<'de> Deserialize<'de> for KeyTrigger
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for KeyTrigger
impl Display for KeyTrigger
impl Eq for KeyTrigger
Source§impl FromStr for KeyTrigger
impl FromStr for KeyTrigger
Source§impl Hash for KeyTrigger
impl Hash for KeyTrigger
Source§impl Ord for KeyTrigger
impl Ord for KeyTrigger
Source§fn cmp(&self, other: &KeyTrigger) -> Ordering
fn cmp(&self, other: &KeyTrigger) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for KeyTrigger
impl PartialEq for KeyTrigger
Source§impl PartialOrd for KeyTrigger
impl PartialOrd for KeyTrigger
Source§impl Serialize for KeyTrigger
impl Serialize for KeyTrigger
impl StructuralPartialEq for KeyTrigger
Auto Trait Implementations§
impl Freeze for KeyTrigger
impl RefUnwindSafe for KeyTrigger
impl Send for KeyTrigger
impl Sync for KeyTrigger
impl Unpin for KeyTrigger
impl UnsafeUnpin for KeyTrigger
impl UnwindSafe for KeyTrigger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.