c po trop bien vu ici...
mais si ça t'amuse :
//NETSCAPE
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
window.onmousedown=rightclick;
window.onmouseup=rightclick;
window.captureEvents(Event.KEYPRESS | Event.KEYDOWN)
window.onkeypress= keyboard
window.onkeydown= keyboard
function keyboard(e){
//e.which==code_du_clavier
alert("ShortCuts are not enabled !" )
releaseEvents(e);
return false;
}
function rightclick(e) {
if (e.which == 3) {
releaseEvents(e)
return false;
}
else {
return true;
}
}
}
//IE
else {
function click() {
if (event.button==2) {
alert('You do not need this !!!'
}
if (event.button==3) {
alert('You do not need this !!!'
}
}
function keydown() {
// window.event.type retourne le type d'évènement (keydown, keypress, ...)
if ((window.event.ctrlKey) || (window.event.shiftKey) || (window.event.keyCode==18) || ((window.event.keyCode>=112) && (window.event.keyCode<=123))) {
if (window.confirm("Shortcuts are not allowed ! \nDo you want to exit this great site ?" ))
top.close();
else {
setTimeout("document.focus();",30); // remet le focus sur la page
window.event.returnValue = false; // fct uniquement avec IE5 (annule l'évènement)
}
}
}
document.onmousedown= click
document.onkeydown= keydown //All Keys are checked
// document.onkeypress = keydown //seulement les touches normales
}
[edtdd]--Message édité par ethernal--[/edtdd]