pub struct Shortcut {
pub mods: Modifiers,
pub key: Code,
pub id: u32,
}
Expand description
Fields§
§mods: Modifiers
The hotkey modifiers.
key: Code
The hotkey key.
id: u32
The hotkey id.
Implementations§
Source§impl HotKey
impl HotKey
Sourcepub fn new(mods: Option<Modifiers>, key: Code) -> HotKey
pub fn new(mods: Option<Modifiers>, key: Code) -> HotKey
Creates a new hotkey to define keyboard shortcuts throughout your application.
Only Modifiers::ALT
, Modifiers::SHIFT
, Modifiers::CONTROL
, and Modifiers::SUPER
Sourcepub fn id(&self) -> u32
pub fn id(&self) -> u32
Returns the id associated with this hotKey which is a hash of the string represention of modifiers and key within this hotKey.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Converts this hotkey into a string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HotKey
impl<'de> Deserialize<'de> for HotKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<HotKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<HotKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<HotKey> for ShortcutWrapper
impl From<HotKey> for ShortcutWrapper
Source§impl Serialize for HotKey
impl Serialize for HotKey
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 HotKey
impl Eq for HotKey
impl StructuralPartialEq for HotKey
Auto Trait Implementations§
impl Freeze for HotKey
impl RefUnwindSafe for HotKey
impl Send for HotKey
impl Sync for HotKey
impl Unpin for HotKey
impl UnwindSafe for HotKey
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
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.