2 small experiments were done today, shielding the keyboard is not available shielded mouse right button unavailable
Test one, the shielding keyboard is not available
There are 3 keyboard events
A, KeyDown: Press a key on the keyboard trigger, always hold down a key will continue to trigger
B, KeyPress: Press a key and generate characters when the trigger, that is, ignore Shift,alt,ctrl and other function keys
C, KeyUp: Trigger when releasing a key
Copy Code code as follows:
<script language= "JavaScript" >
function block () {
Event.keycode = 0;
Event.returnvalue = false;
Alert ("Keyboard unavailable.");
}
Document.onkeypress = Block;
</script>
Experiment two, the screen mouse right button is not available
Copy Code code as follows:
<script language= "JavaScript" >
function Block (oevent) {
if (window.event) {
Oevent = window.event;
}
if (Oevent.button = = 2) {
Alert ("Mouse right button is not available");
}
}
Document.onmousedown = Block;
</script>
haha ~ As on the implementation of shielding function