How to disable CTRL key combinations on your web pages? [STEP BY STEP]☑️
Here in this tutorial, we will explain you how to disable CTRL key combinations on your webpages.
Video Tutorial– “How to disable CTRL key combinations on your webpages?”
Follow the steps to disable CTRL key combinations on your web pages:
Step::1 Login to your cPanel interface

Step::2 Click on the File Manager icon under the Files section

Step::3 Go to public_html

Step::4 Create a .html file. with any name like test.html or control.html

Step::5 Once the file is created, right-click over the file and choose the Edit option

Step::6 Enter the code given below
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Disable Ctrl Key Combinations </title>
<script language="JavaScript">
function disableCtrlKeyCombination(e)
{
//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w');
var key;
var isCtrl;
if(window.event)
{
key = window.event.keyCode; //IE
if(window.event.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
else
{
key = e.which; //firefox
if(e.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl)
{
for(i=0; i<forbiddenKeys.length; i++)
{
//case-insensitive comparation
if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
{
alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.');
return false;
}
}
}
return true;
}
</script>
</head>
<body onkeypress="return disableCtrlKeyCombination(event);" onkeydown="return disableCtrlKeyCombination(event);">
Press ctrl and you can check various key is disable with CTRL. like — 'a', 'n', 'c', 'x', 'v', 'j' , 'w' Just add key in above the array and disable key as you want.
</body>
</html>
Step::7 Save the file by clicking on Save changes

Now try to open that particular page where you have added the code and verify that it’s working or not…

In this way, you could disable CTRL key combinations on your web pages.
Thanks for reading this article !!! We hope this was helpful to you all.
For more information, kindly follow us on social media like Twitter and Facebook, and for video tutorials, subscribe to our YouTube channel –https://youtube.com/redserverhost
Facebook Page– https://facebook.com/redserverhost
Twitter Page– https://twitter.com/redserverhost
If you have any suggestions or problems related to this tutorial, please let us know via the comment section below.
Tags: cheap linux hosting, buy linux hosting, cheap reseller hosting, buy reseller hosting, best reseller hosting, cheap web hosting, cheapest web hosting, cheapest reseller hosting, cheap reseller host, cheap linux host, cheapest linux hosting, best linux hosting, best web hosting





