wilix-team / iohook

Node.js global keyboard and mouse listener.
https://wilix-team.github.io/iohook
MIT License
1.2k stars 291 forks source link

On macOS big sur 11.1 version, it records keydown only once, keyup not even once. It should record these events on every keyup/keydown. #295

Closed jangidsh4 closed 3 years ago

jangidsh4 commented 3 years ago

Expected Behavior

Keydown/keyupevent should be triggered every time

Current Behavior

Keyup/keydown events are triggered only once mousemove and mouse click works fine until no key is pressed Keyup is not working even at first click keydown chokes everything, event mouse events when first key is pressed.

Possible Solution

No Idea, but it requires a fix to c library, looks like.

Steps to Reproduce (for bugs)

  1. On macOS Big Sur 11.1 version, register keydown/keyup event in node js app using iohook
  2. run the app and see that it only triggers event on first keyup/keydown, not on subsequent hits

Context

I am creating a activity monitor app and would like to see the productivity of the user.

Your Environment

DEV

jangidsh4 commented 3 years ago

never mind, I got it working. Well documented steps by https://github.com/wilix-team/iohook/issues/124#issuecomment-731925826, followed the same but it was not working since I just copied "iohook.node" from iohook node_modules after new build by commenting suggested line. You also need to copy "uiohook.dylib" from the same folder into your ./node_modules/iohook/builds/node-v83-darwin-x64/build/release" folder. And it works. Cheers... node v14.15.3 macOS Big Sur 11.2.1 (updated to the new patch this morning)