So I want to test if visitors of my site have pressed Print Screen button.
As much as I was looking for, there were no information to be found how to do it. All I found was, that ir is supposed to be keyCode == 44.
With all the other buttons I tried there was no problem.
Where is my mistake?
Here's similar, working code for enter button:
window.addEventListener("keydown", checkKeyPressed, false);
function checkKeyPressed(e) {
if (e.keyCode == "13") {
alert("The 'enter' key is pressed.");
}
}
console.log(e.keyCode);
Without the if statement ofcause. – Disparagement