Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Implement global shortcuts #66

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Implement global shortcuts #66

merged 4 commits into from
Dec 21, 2023

Conversation

benebsiny
Copy link
Contributor

@benebsiny
Copy link
Contributor Author

Off topic, won't it be a good idea to add tabs to the statements inside the case?

@benebsiny benebsiny marked this pull request as ready for review June 20, 2023 05:30
src/consts.js Outdated Show resolved Hide resolved
src/consts.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
Copy link
Owner

@asticode asticode left a 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",
Copy link
Owner

@asticode asticode Sep 3, 2023

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}});
Copy link
Owner

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

@asticode
Copy link
Owner

👍 I'll merge this PR once its GO counter-part is OK

Off topic, won't it be a good idea to add tabs to the statements inside the case?

If you feel like it, that would be a good idea indeed 👍

@asticode asticode merged commit 4c42fe4 into asticode:master Dec 21, 2023
@asticode
Copy link
Owner

Thanks for the PR! ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants