全局快捷键
Last updated
Was this helpful?
Last updated
Was this helpful?
应用于键盘无焦点时的键盘快捷键.
进程:
global-shortcut
模块可以便捷的设置(注册/注销)各种自定义操作的快捷键.
注意: 这种快捷键是全局性的,即键盘没有聚焦于应用时,本模块需应用于在 ready
后.
globalShortcut.register(accelerator, callback)
用途:注册快捷键
accelerator
callback
Function 按下快捷键后的操作
如果快捷键已经被其他应用程序注册了,这个 callback
将静默失败。
globalShortcut.isRegistered(accelerator)
用途:判断快捷键
accelerator
是否已经被注册
globalShortcut.unregister(accelerator)
用途:注销快捷键
accelerator
globalShortcut.unregisterAll()
用途:注销应用注册的所有快捷键
accelerator
accelerator
accelerator