1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nouvelle page 2</title>
<script type='text/javascript'>
function remplaceCtrlTouche(e, toucheInterdite, fonction){
var key;
var CtrlDown;
if(window.event) {
key = window.event.keyCode; //IE
CtrlDown=(window.event.ctrlKey)?true:false;
}
else {
key = e.which; //firefox
CtrlDown=(e.ctrlKey)?true:false;
}
if(CtrlDown) { //La touche Ctrl à été enfoncée, verfication de combinaison
//verification de casse
if(toucheInterdite.toLowerCase() === String.fromCharCode(key).toLowerCase()){
// ici lancement de la fonction de substitution
fonction()
// annulation de la fonction originale
return false;
}
}
return true;
}
function maRecherchePerso(){
alert('faut pas vouloir copier')
}
</script>
</head>
<body onkeydown="return this.onkeypress();" onkeypress="return remplaceCtrlTouche(event,'A', maRecherchePerso)">
</body>
</html> |