Created
September 28, 2021 15:24
-
-
Save ridheshcybe/4569b0d629b1d00b0de5c74beefa0eb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("keydown", function(e){ | |
// USE THIS TO DISABLE CONTROL AND ALL FUNCTION KEYS | |
// if (e.ctrlKey || (e.keyCode>=112 && e.keyCode<=123)) { | |
// THIS WILL ONLY DISABLE CONTROL AND F12 | |
if (e.ctrlKey || e.keyCode==123) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment