Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: 'static {
    // Required methods
    fn name(&self) -> String;
    fn start(&mut self, presses: Presses, status: Arc<SystemKeys>) -> Support;
    fn register(&mut self, shortcuts: &[Shortcut]);
    fn stop(&mut self);
}
Expand description

What registers global shortcuts with the desktop. It lives on the interface thread (global-hotkey’s manager is tied to it on Windows and macOS); its threads write each registration’s state to status.

Required Methods§

Source

fn name(&self) -> String

A short name: x11, windows, macos, portal, simulated.

Source

fn start(&mut self, presses: Presses, status: Arc<SystemKeys>) -> Support

Starts; says whether the desktop takes global shortcuts (it may say later, through status).

Source

fn register(&mut self, shortcuts: &[Shortcut])

Registers exactly these (the earlier ones go), each one’s state written to status now or later.

Source

fn stop(&mut self)

Takes every shortcut back.

Implementors§

Source§

impl Backend for HotKeys

Source§

impl Backend for Portal

Available on Unix and non-macOS and non-WebAssembly only.
Source§

impl Backend for Simulated