This question already has an answer here:
- Stop User from using “Print Scrn” / “Printscreen” key of the Keyboard for any Web Page 11 answers
I'm trying to disable the print screen key on my website. This is what I have so far:
<SCRIPT type="text/javascript">
focusInput = function()
{
document.focus();
};
processKeyEvent = function(eventType, event)
{
if (window.event)
{
event = window.event;
}
if(event.keyCode == 44)
{
alert("Photos are copyright 2011");
return(false);
}
}
processKeyUp = function(event)
{
processKeyEvent("onkeyup", event);
};
processKeyDown = function(event)
{
processKeyEvent("onkeydown", event);
};
document.onkeyup = processKeyUp;
document.onkeydown = processKeyDown;
</SCRIPT>
But this isn't working. How can I disable the print screen key to prevent users from making a snapshot of my site?