I want to run a process in the background in NodeJS, that wait until the computer not in use for 10 minutes. I mean the user do not touch the keyboard or the mouse.

In other words: I want to listen to keyboard and mouse events in any window, and notify my app when it is happend.

For this mission, I able to use plain node, or nw.js or electron.

I think that I must to use a C++, native module and DLL's. But I hope there is a better and simple solution.

Do you have?