Reputation: 559
I am looking for a package for listening mouse and keyboard events system wide. I am using electron and nodejs.
I tried:
iohook and it did not work in MacOS (supports macOS High Sierra 10.13.2 and older)
https://wilix-team.github.io/iohook/os-support.html.
This doesn't work for Catalina.
gkm works fine however it needs Java (JVM)
https://www.npmjs.com/package/gkm
github https://github.com/tomzx/gkm
I did lots of search but did not manage to find any others that will help.
Are there any mouse/keyboard listeners which supports mac/windows new versions; and which does not depend on other languages?
Upvotes: 4
Views: 1453
Reputation: 388
So since I couldn't find a good alternative nodejs module to iohook that hasn't died off years ago and no longer works... I decided to make my own by updating a fork (which is itself a fork of the OG iohook, lol)
It also has a feature the original didn't... Key code to key name parsing! (Note: Probably only fully works in a US QWERTY layout, but MOST of the keys should be right in any layout)
You can find it here: https://github.com/Pecacheu/node-iohook
Or install it with npm install iohook2
Upvotes: 1