<html>
<head>
<script language="javascript"> 1:
2:
3: document.onkeydown = funDown;
4:
5: if (document.layers) window.captureEvents(Event.MOUSEDOWN);
6: window.onmousedown=bderecho;
7: document.onmousedown=bderecho;
8: function funDown()
9: { 10: var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();
11: if (event.ctrlKey && (pressedKey == "n" || pressedKey == "r" || pressedKey == "u" ||
12: pressedKey == "q" || pressedKey == "w" || pressedKey == "i" ||
13: pressedKey == "o" || pressedKey == "p" || pressedKey == "a" ||
14: pressedKey == "h"))
15: { 16: alert("Presiona Ctrl+N, CTRL+R, CTRL+U Bloquedas"); 17: return false;
18: }
19: //Bloquea la tecla Ctrl+Insert
20: if (event.ctrlKey && window.event.keyCode == 45)
21: { 22: alert("Presiona Ctrl+Insert"); 23: return false;
24: }
25:
26: //Captura la tecla BackSpace
27: if(window.event && window.event.keyCode == 8)
28: { 29: alert("Presino BackSpace"); 30: window.event.keyCode = 555;
31: return false;
32: }
33: //Captura la tecla Tab
34: if(window.event && window.event.keyCode == 9)
35: { 36: alert("Presino TAB"); 37: window.event.keyCode = 555;
38: return false;
39: }
40: //Captura la tecla F5
41: if(window.event && window.event.keyCode == 116)
42: { 43: alert("Presino F5"); 44: window.event.keyCode = 555;
45: return false;
46: }
47: //Captura la tecla F11
48: if(window.event && window.event.keyCode == 122)
49: { 50: alert("Presino F11"); 51: window.event.keyCode = 555;
52: return false;
53: }
54: //Captura la tecla Alt y AltGr que manejan el mismo ASCII
55: if(window.event && window.event.keyCode == 18)
56: { 57: alert("Presino Alt o AltGr"); 58: window.event.keyCode = 555;
59: return false;
60: }
61: //Captura la tecla que saca la ventana emergente, simulando click //derecho con el ratón
62: if(window.event && window.event.keyCode == 93)
63: { 64: alert("Presino Tecla traicionera"); 65: //window.event.keyCode = 555;
66: return false;
67: }
68:
69: if(event.button == 2 || event.button == 3)
70: { 71: alert("Presino Click derecho"); 72: //window.event.keyCode = 555;
73: return false;
74: }
75: return true;
76: }
77:
78: function bderecho(e)
79: { 80: if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
81: return false;
82: else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
83: { 84: alert(" El boton derecho del raton no funciona "); 85: return false;
86: }
87: return true;
88: }
89:
</script>
</head>
<body>
<form id="Form1" method="post">
<INPUT type="text">
</form>
</body>
</html>