tomzx / gkm

⚠ Unsupported/Unmaintained ⚠️️ Global Keyboard and Mouse listener for node.js.
MIT License
52 stars 16 forks source link

How to delete listeners? #12

Closed EugeneHerasymchuk closed 6 years ago

EugeneHerasymchuk commented 6 years ago

Is it possible to add a hook to remove all listeners? It's quite useful in event handler:

process.on('exit'....
tomzx commented 6 years ago

Please refer to EventEmitter2 documentation on how to remove listeners.

Something like gkm.events.removeAllListeners(eventName) should do the trick.

Note that gkm spawns a single listener process (for both keyboard and mouse) in Java (running gkm.jar) that will run until your program is terminated.