pub struct GlobalShortcut<R: Runtime> { /* private fields */ }
Implementations§
source§impl<R: Runtime> GlobalShortcut<R>
impl<R: Runtime> GlobalShortcut<R>
sourcepub fn on_shortcut<S, F>(&self, shortcut: S, handler: F) -> Result<(), Error>where
S: TryInto<ShortcutWrapper>,
S::Error: Error,
F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,
pub fn on_shortcut<S, F>(&self, shortcut: S, handler: F) -> Result<(), Error>where
S: TryInto<ShortcutWrapper>,
S::Error: Error,
F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,
Register a shortcut with a handler.
sourcepub fn register_all<S, T>(&self, shortcuts: S) -> Result<(), Error>
pub fn register_all<S, T>(&self, shortcuts: S) -> Result<(), Error>
Register multiple shortcuts.
sourcepub fn on_all_shortcuts<S, T, F>(
&self,
shortcuts: S,
handler: F
) -> Result<(), Error>where
S: IntoIterator<Item = T>,
T: TryInto<ShortcutWrapper>,
T::Error: Error,
F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,
pub fn on_all_shortcuts<S, T, F>(
&self,
shortcuts: S,
handler: F
) -> Result<(), Error>where
S: IntoIterator<Item = T>,
T: TryInto<ShortcutWrapper>,
T::Error: Error,
F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,
Register multiple shortcuts with a handler.
pub fn unregister<S: TryInto<ShortcutWrapper>>( &self, shortcut: S ) -> Result<(), Error>
pub fn unregister_all<T: TryInto<ShortcutWrapper>, S: IntoIterator<Item = T>>( &self, shortcuts: S ) -> Result<(), Error>
sourcepub fn is_registered<S: TryInto<ShortcutWrapper>>(&self, shortcut: S) -> bool
pub fn is_registered<S: TryInto<ShortcutWrapper>>(&self, shortcut: S) -> bool
Determines whether the given shortcut is registered by this application or not.
If the shortcut is registered by another application, it will still return false
.
Auto Trait Implementations§
impl<R> Freeze for GlobalShortcut<R>
impl<R> !RefUnwindSafe for GlobalShortcut<R>
impl<R> Send for GlobalShortcut<R>
impl<R> Sync for GlobalShortcut<R>
impl<R> Unpin for GlobalShortcut<R>
impl<R> !UnwindSafe for GlobalShortcut<R>
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