Answer the question
In order to leave comments, you need to log in
Is it possible to monitor keypresses in a system in nodeJs?
I want to create a program in nodeJs, and I want it to run a certain action when a key is pressed, but so that the program is in the background, is there any way to monitor this in nodeJs on windows ?
Answer the question
In order to leave comments, you need to log in
ElectronJS , you can create a desktop application using HTML CSS and JS with it, and it works just fine with node, just in the parameters of the electron window, write:
transparent: true, // прозрачность окна
show: false // скрытие ярлыка программы с панели задач
webPreferences: {
nodeIntegration: true
}
document.addEventListener("keydown", e => {
if(e.key == "C"){
console.log("нажал на C");
}
}); // также есть еще keypress и keyup
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question