pub trait GlobalShortcutManager: Debug + Clone + Send + Sync {
    // Required methods
    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§

source

fn is_registered(&self, accelerator: &str) -> Result<bool, Error>

Whether the application has registered the given accelerator.

source

fn register<F>(&mut self, accelerator: &str, handler: F) -> Result<(), Error>where F: Fn() + Send + 'static,

Register a global shortcut of accelerator.

source

fn unregister_all(&mut self) -> Result<(), Error>

Unregister all accelerators registered by the manager instance.

source

fn unregister(&mut self, accelerator: &str) -> Result<(), Error>

Unregister the provided accelerator.

Implementors§

source§

impl GlobalShortcutManager for MockGlobalShortcutManager

Available on crate feature test only.