document.onmousedown="if (event.button==2) return false";
document.oncontextmenu=new Function("return false");//disable right click
document.onkeydown = showDown;
function showDown(evt)
{
evt = (evt)? evt : ((event)? event : null);
if (evt) {
if (event.keycode == 8 && (event.srcElement.type!= "text" && event.srcElement.type!= "textarea" && event.srcElement.type!= "password")) {
// When backspace is pressed but not in form element
cancelKey(evt);
}
else if (event.keycode == 116) {
// When F5 is pressed
alert("asdfasfdasd");
cancelKey(evt);
}
else if (event.keycode == 122) {
// When F11 is pressed
cancelKey(evt);
}
else if (event.ctrlKey && (event.keycode == 78 ¦¦ event.keycode == 82)) {
// When ctrl is pressed with R or N
cancelKey(evt);
}
else if (event.altKey && event.keycode==37 ) {
// stop Alt left cursor
return false;
}
}
}
function cancelKey(evt) {
if (evt.preventDefault) {
evt.preventDefault();
return false;
}
else {
evt.keycode = 0;
evt.returnValue = false;
}
}
Thursday, April 10, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment