react-nodegui icon indicating copy to clipboard operation
react-nodegui copied to clipboard

OS key events (globalShortcut)

Open R-Bower opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. The react-nodegui instance can't detect key events when the application doesn't have focus.

Describe the solution you'd like Detect keyboard events when the application does not have keyboard focus (similar to electron's globalShortcut)

Describe alternatives you've considered

  • Using a local redis store for storing and responding to OS events.
  • Mapping a keyboard shortcut to a process that starts the react-nodegui application.

R-Bower avatar Dec 30 '20 04:12 R-Bower

Can you see if there are any existing node module that does this already ?

a7ul avatar Dec 30 '20 05:12 a7ul

https://www.npmjs.com/package/iohook

This should do it?

a7ul avatar Dec 30 '20 05:12 a7ul

https://www.npmjs.com/package/iohook

This should do it?

import iohook from "iohook" then, when I npm run dev

Critical dependency: the request of a dependency is an expression
 @ multi webpack/hot/poll?100 ./src/index.js

npm start fails with: Error: Cannot find module '/builds/node-v83-linux-x64/build/Release/iohook.node'

I've also tried adding iohook to the webpack config's externals, like so: externals: {iohook: "iohook"},

But this fails on npm start with

module.exports = iohook;
                 ^
ReferenceError: iohook is not defined

R-Bower avatar Dec 30 '20 05:12 R-Bower