pub struct HotKey {
pub mods: Modifiers,
pub key: Code,
pub id: u32,
pub name: Option<String>,
}Expand description
Fields§
§mods: ModifiersThe hotkey modifiers.
key: CodeThe hotkey key.
id: u32The hotkey id.
name: Option<String>The hotkey name.
Implementations§
Source§impl HotKey
impl HotKey
Sourcepub fn new(mods: Option<Modifiers>, key: Code, name: Option<String>) -> Self
pub fn new(mods: Option<Modifiers>, key: Code, name: Option<String>) -> Self
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.
pub fn name(&self) -> Option<String>
Sourcepub fn into_string(&self) -> String
pub fn into_string(&self) -> String
Converts this hotkey into a string.
Trait Implementations§
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