Trait tauri_runtime::GlobalShortcutManager
source · pub trait GlobalShortcutManager:
Debug
+ Clone
+ Send
+ Sync {
// Required methods
fn is_registered(&self, accelerator: &str) -> Result<bool>;
fn register<F: Fn() + Send + 'static>(
&mut self,
accelerator: &str,
handler: F,
) -> Result<()>;
fn unregister_all(&mut self) -> Result<()>;
fn unregister(&mut self, accelerator: &str) -> Result<()>;
}
Expand description
A global shortcut manager.
Required Methods§
sourcefn is_registered(&self, accelerator: &str) -> Result<bool>
fn is_registered(&self, accelerator: &str) -> Result<bool>
Whether the application has registered the given accelerator
.
sourcefn register<F: Fn() + Send + 'static>(
&mut self,
accelerator: &str,
handler: F,
) -> Result<()>
fn register<F: Fn() + Send + 'static>( &mut self, accelerator: &str, handler: F, ) -> Result<()>
Register a global shortcut of accelerator
.
sourcefn unregister_all(&mut self) -> Result<()>
fn unregister_all(&mut self) -> Result<()>
Unregister all accelerators registered by the manager instance.
sourcefn unregister(&mut self, accelerator: &str) -> Result<()>
fn unregister(&mut self, accelerator: &str) -> Result<()>
Unregister the provided accelerator
.
Object Safety§
This trait is not object safe.