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

electron-global-key-listener #13

Open
sancarn opened this issue Jun 13, 2021 · 3 comments
Open

electron-global-key-listener #13

sancarn opened this issue Jun 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@sancarn
Copy link
Contributor

sancarn commented Jun 13, 2021

Might be useful to add an electron specific global key listener. This package would have the following advantages:

  • Fallback to electron::globalShortcut() for registering keyboard shortcuts, if node-global-key-listener doesn't have permission.
  • A utility to allow continued usage of node-global-key-listener when packaged into an asar package.
@sancarn sancarn added the enhancement New feature or request label Jun 13, 2021
@Metainy
Copy link

Metainy commented Dec 29, 2021

Is there any plans to follow through on that?

Currently I am using Vue CLI Plugin Electron Builder
Node v15.x.x ~ v16.13.1
Electron v13

It works in development with externals: ["node-global-key-listener"] added in Webpack configuration but I get error code -4058 when packaged. Same exact behavior on a packaged node app using nexe or pkg.

@AnEmortalKid
Copy link

AnEmortalKid commented May 31, 2022

In my case, the winKeyServer wasn't being found so I had to use this path in both prod/dev:

serverPath: path.join(__dirname, "../../node_modules/node-global-key-listener/bin/WinKeyServer.exe")

Since as far as I can tell, with the later electrons, the executable runs from:

resources
  app
    .webpack
      main
    node_modules

@TarVK
Copy link
Member

TarVK commented Jun 1, 2022

I wouldn't be surprised if the main entry that is run from a packaged electron app depends on what tool you use for packaging the app. So it may be impossible to give a single path that works for everyone.
I however don't know enough about this myself, but if this is indeed the case, it would be useful to start keeping track of these different paths and add such configurations for specific packagers in the readme.

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

No branches or pull requests

4 participants