-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application Crashes When onInputEvent is Used in Electron MacOS Environment #129
Comments
same error, Did you find any solution? |
I found a temporarily solution, you can use // child.js
const { startListener } = require('node-rdev');
startListener((dataStr) => {
process.send(dataStr);
}); // your electron som code ...
const childProcess = fork(join(app.getAppPath(), './dist/main/child/index.js'));
childProcess.on('message', (message: string) => {
console.log(message)
}); |
Sorry for the late reply. I handle it exactly like that. It works fine now on a regular Mac, but it will fail if the Mac is being controlled by remote software. |
I haven't found a reason for it yet, and I haven't found a suitable alternative monitoring method either. The priority of the issue of Mac being remotely controlled by the product is also relatively low. So sad~ |
The rdev is wrapped with @napi-rs/cli for nodejs use
Here is the code
There's no problem using it in nodejs alone.
Install electron main.js and fill in some simple sample code. At the beginning, the capture seems to be normal. The focus is placed on the new window. As soon as a button is pressed, the application crashes.
Below is the simplest reproducible demo
main.js
package.json
Or, is there a way to only monitor the mouse... skip the keyboard events...
Appendix: Issue Report
The text was updated successfully, but these errors were encountered: