JS screen function key f1~12 and the right mouse button and the left mouse button

Source: Internet
Author: User

function Window.onhelp () {return false}//masking F1 Help

Document.onkeydown = function () {

if (window.event && window.event.keyCode = = 113) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 114) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 115) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 116) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 117) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 118) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 119) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 120) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 121) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 122) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 123) {
Alert ("F12 is disabled");
event.keycode=0;
Event.returnvalue=false;
}
if (window.event && window.event.keyCode = = 13) {
Window.event.keyCode = 505;
}
if (window.event && window.event.keyCode = = 8) {
Alert (str+ "\ n Please use the DEL key to delete the characters!) ");
Window.event.returnvalue=false;
}
if (window.event && window.event.keyCode = = 505) {
Alert (str)
Window.event.returnvalue=false;
}
}

Document.onmousedown=function (oevent) {
if (window.event)
Oevent=window.event;
if (oevent.button==2)
Alert ("right mouse button is not available");
if (oevent.button==1)
Alert ("Left mouse button unavailable");

}

right mouse button disabled there is a way

<script type= "text/javascript" >document.oncontextmenu = function (e) {return false;} </script>

JS screen function key f1~12 and right mouse button and left mouse button

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.