我最近正在使用Github的Electron文档。他们使用的一个例子
const electron = require('electron') const app = electron.app const dialog = electron.dialog const globalShortcut = electron.globalShortcut
app.on('ready', function () { globalShortcut.register('CommandOrControl+Alt+K', function () {
dialog.showMessageBox({
type: 'info',
message: 'Success!',
detail: 'You pressed the registered global shortcut keybinding.',
buttons: ['OK']
}) }) })
app.on('will-quit', function () { globalShortcut.unregisterAll() })
这似乎是键盘挂钩的跨平台解决方案。但是上面的示例全局注册键盘快捷键。有可能以一种方式记录所有击键而不会妨碍用户吗?例如,如果我要按。我的网络浏览器上的'ctrl + w'我希望我的电子应用程序注册ctrl + w。但并不妨碍它在weeb浏览器上的功能。
有可能吗?