constglobalShortcut:object
Defined in: global-shortcut.ts:56
isRegistered: (
id) =>Promise<boolean>
是否已有此 id 的快捷键处于注册状态。
string
Promise<boolean>
onShortcut: (
handler) =>Promise<() =>Promise<void>>
监听全局快捷键触发。
(event) => void
Promise<() => Promise<void>>
register: (
id,accelerator) =>Promise<boolean> =registerShortcut
注册一个全局热键。
string
string
Promise<boolean>
registerAll: (
entries) =>Promise<boolean[]>
一次调用批量注册热键(上游 registerAll)。按顺序返回每条的成功标志。
object[]
Promise<boolean[]>
unregister: (
id) =>Promise<boolean> =unregisterShortcut
按 id 注销之前注册的热键。
string
Promise<boolean>
unregisterAll: () =>
Promise<boolean>
注销本进程注册的全部热键(上游同名)。
Promise<boolean>
isRegistered(
id):Promise<boolean>
Defined in: global-shortcut.ts:40
是否已有此 id 的快捷键处于注册状态。
string
Promise<boolean>
onShortcut(
handler):Promise<() =>Promise<void>>
Defined in: global-shortcut.ts:48
监听全局快捷键触发。handler 收到 registerShortcut 注册时用的快捷键 id。
(event) => void
Promise<() => Promise<void>>
registerAll(
entries):Promise<boolean[]>
Defined in: global-shortcut.ts:28
一次调用批量注册热键(上游 registerAll)。按顺序返回每条的成功标志。
object[]
Promise<boolean[]>
registerShortcut(
id,accelerator):Promise<boolean>
Defined in: global-shortcut.ts:12
注册一个全局热键。accelerator 形如 Cmd+Shift+K、Ctrl+Alt+1、F5 等。返回 OS 是否接受了这次注册。
string
string
Promise<boolean>
unregisterAll():
Promise<boolean>
Defined in: global-shortcut.ts:35
注销本进程注册的全部热键(上游同名)。
Promise<boolean>
unregisterShortcut(
id):Promise<boolean>
Defined in: global-shortcut.ts:20
按 id 注销之前注册的热键。
string
Promise<boolean>