Trait tauri::GlobalShortcutManager
source · pub trait GlobalShortcutManager: Debug + Clone + Send + Sync {
fn is_registered(&self, accelerator: &str) -> Result<bool, Error>;
fn register<F>(&mut self, accelerator: &str, handler: F) -> Result<(), Error>
where
F: Fn() + Send + 'static;
fn unregister_all(&mut self) -> Result<(), Error>;
fn unregister(&mut self, accelerator: &str) -> Result<(), Error>;
}
Available on crate feature
global-shortcut
only.Expand description
A global shortcut manager.
Required Methods§
sourcefn is_registered(&self, accelerator: &str) -> Result<bool, Error>
fn is_registered(&self, accelerator: &str) -> Result<bool, Error>
Whether the application has registered the given accelerator
.
sourcefn register<F>(&mut self, accelerator: &str, handler: F) -> Result<(), Error>where
F: Fn() + Send + 'static,
fn register<F>(&mut self, accelerator: &str, handler: F) -> Result<(), Error>where
F: Fn() + Send + 'static,
Register a global shortcut of accelerator
.
sourcefn unregister_all(&mut self) -> Result<(), Error>
fn unregister_all(&mut self) -> Result<(), Error>
Unregister all accelerators registered by the manager instance.