catchup
06-14-2003, 08:45 AM
:) Hi,
the following disables any key on the keyboard that has a numeric code associated with it, ex. f5 being 116, what if i wanted to diasble the print screen key? any ideas? I know one could blur the page and still then print screen, I'm not concerned with that as i'm on a mission to diable printscreen key via JS webpage... and suggestions?
//Disable right mouse click Script
var message="Function Disabled!";
function clickIE4(){if (event.button==2){alert(message);return false;}}
function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("alert(message);return false")
//Disable f5 key
if (document.all){
document.onkeydown = function (){
var key_f5 = 116; // 116 = F5
if (key_f5==event.keyCode){
alert("Refreshing the browser will add the record again. Please choose cancel when asked to refresh.");
return false;
}
}
}
the following disables any key on the keyboard that has a numeric code associated with it, ex. f5 being 116, what if i wanted to diasble the print screen key? any ideas? I know one could blur the page and still then print screen, I'm not concerned with that as i'm on a mission to diable printscreen key via JS webpage... and suggestions?
//Disable right mouse click Script
var message="Function Disabled!";
function clickIE4(){if (event.button==2){alert(message);return false;}}
function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("alert(message);return false")
//Disable f5 key
if (document.all){
document.onkeydown = function (){
var key_f5 = 116; // 116 = F5
if (key_f5==event.keyCode){
alert("Refreshing the browser will add the record again. Please choose cancel when asked to refresh.");
return false;
}
}
}