electron_sys/module/
global_shortcut.rs1use js_sys::Function;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen(module = "electron")]
5extern {
6 #[wasm_bindgen]
7 pub type GlobalShortcut;
8
9 #[wasm_bindgen(js_name = "globalShortcut")]
10 pub static global_shortcut: GlobalShortcut;
11
12 #[wasm_bindgen(method)]
13 pub fn register(this: &GlobalShortcut, accelerator: &str, callback: &Function);
14
15 #[wasm_bindgen(method, js_name = "registerAll")]
16 pub fn register_all(this: &GlobalShortcut, accelerators: Box<[JsValue]>, callback: &Function);
17
18 #[wasm_bindgen(method, js_name = "isRegistered")]
19 pub fn is_registered(this: &GlobalShortcut, accelerator: &str) -> bool;
20
21 #[wasm_bindgen(method)]
22 pub fn unregister(this: &GlobalShortcut, accelerator: &str);
23
24 #[wasm_bindgen(method, js_name = "unregisterAll")]
25 pub fn unregister_all(this: &GlobalShortcut);
26}