-
Notifications
You must be signed in to change notification settings - Fork 67
Conversation
Off topic, won't it be a good idea to add tabs to the statements inside the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping me when changes have been made 👍
src/consts.js
Outdated
globalShortcutEventUnregistered: "global.shortcuts.event.unregistered", | ||
globalShortcutEventUnregisteredAll: "global.shortcuts.event.unregistered.all", | ||
globalShortcutEventProcessFinished: "global.shortcuts.event.process.finished", | ||
globalShortcutEventTriggered: "global.shortcuts.event.triggered", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We misunderstood each other: could you rollback all globalShortcutCmd...
events but replace the globalShortcutEventProcessFinished
with:
- global.shortcuts.event.
- global.shortcuts.event.is.
- global.shortcuts.event.
- global.shortcuts.event.unregistered.all
Also, could you make sure there's an s
at the end of globalShortcut
in the key?
This should look like this:
globalShortcutsCmdRegister: "global.shortcuts.cmd.register",
globalShortcutsCmdIsRegistered: "global.shortcuts.cmd.is.register",
globalShortcutsCmdUnregister: "global.shortcuts.cmd.unregister",
globalShortcutsCmdUnregisterAll: "global.shortcuts.cmd.unregister.all",
globalShortcutsEventRegistered: "global.shortcuts.event.registered",
globalShortcutsEventIsRegistered: "global.shortcuts.event.is.registered",
globalShortcutsEventUnregistered: "global.shortcuts.event.unregistered",
globalShortcutsEventUnregisteredAll: "global.shortcuts.event.unregistered.all",
globalShortcutsEventProcessFinished: "global.shortcuts.event.process.finished",
globalShortcutsEventTriggered: "global.shortcuts.event.triggered",
globalShortcutsCmd...
are the events received by javascript, globalShortcutsEvent...
are the events sent by javascript.
index.js
Outdated
client.write(json.targetID, consts.eventNames.globalShortcutEventTriggered, {GlobalShortcut:{accelerator: json.globalShortcut.accelerator}}); | ||
case consts.eventNames.globalShortcutEventRegistered: | ||
const isRegistered = globalShortcut.register(json.globalShortcuts.accelerator, () => { | ||
client.write(json.targetID, consts.eventNames.globalShortcutEventTriggered, {GlobalShortcuts:{accelerator: json.globalShortcuts.accelerator}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use globalShortcuts
with a lower g
instead of GlobalShortcuts
in the json. Same thing below
👍 I'll merge this PR once its GO counter-part is OK
If you feel like it, that would be a good idea indeed 👍 |
Thanks for the PR! ❤️ |
See asticode/go-astilectron#393