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

Only listen for Global Keyboard Shortcuts? #340

Open chrisspiegl opened 3 years ago

chrisspiegl commented 3 years ago

Expected Behavior

This may be mostly a feature request.

I like how this library does the keyboard capturing but I do not need the part of it that does the mouse tracking.

Expectation would be to either have options or dedicated start functions for different modes.

Current Behavior

ioHook.start() starts listening for just about everything.

Possible Solution

Implementation of something like:

ioHook.start({
  keyboardEvents: true,
  mouseEvents: false,
})

My assumption is that this would use less CPU power.

I am aware that I can selectively listen for events but I assume that the capturing and firing of the unnecessary events could be reduced.

Thank you for your consideration 🌸

ash0x0 commented 3 years ago

Will definitely add this once I get to features.