Module workflow_nw::shortcut

source ·
Expand description

Builder for application shortcuts.

§Synopsis

use workflow_nw::prelude::*;
use workflow_nw::result::Result;
use workflow_dom::utils::window;


let shortcut = ShortcutBuilder::new()
    .key("Ctrl+Shift+Q")
    .active(|_|{
        window().alert_with_message("Ctrl+Shift+Q pressed, App will close")?;
        //nw_sys::app::quit();
        nw_sys::app::close_all_windows();
        Ok(())
    })
    .build()?;
     
nw_sys::app::register_global_hot_key(&shortcut);

Structs§