Athos Oc Athos Oc - 3 years ago 126
Javascript Question

nodejs program detect keypress event on terminal lost focus

I'm developing a small node js program that consists on a list of copies (ctrl+c) and then paste it (ctrl+v) secuentially. I run the program on terminal, and it work fine. The problem is when this terminal lost the focus. When it occurs, the program can't detect keypress events, so I cant "save" the selected text when key combination is pressed.

The project is here if you want see the code (main.js).

https://github.com/athos54/advancedcopypaste

Thanks very much

Answer Source

I believe that iohook may be the tool you're looking for. Check out this answer from Stack Overflow: https://stackoverflow.com/a/41441872/4932490

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download