How to disable CTRL key combinations on your webpages? Serverhosthub – The Hosting Platform Made For You – Go Online With Hosting serverhosthub | free hosting | Linux shared hosting | Hosting | Free domain | Life time Free ssl certificate | Chepest web hosting | Low price hosting | Domain Transfer

Here in this tutorial we will show 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 webpages:

Phase 1 login to your seapanel interface

Phase 2 click on file manager down icon files section

How to Disable CTRL Key Combinations on Your Webpages

step 3 go for public_html

How to Disable CTRL Key Combinations on Your Webpages

step 4 make .html file. by any name test.html Or control.html

How to Disable CTRL Key Combinations on Your Webpages

Step::5 Once the file is created, right click on the file and select Edit the option

How to Disable CTRL Key Combinations on Your Webpages

Step::6 enter the code 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>

How to Disable CTRL Key Combinations on Your Webpages

Step::7 Save the file by clicking on save Changes

How to Disable CTRL Key Combinations on Your Webpages

Now try to open the particular page where you have added the code and verify if it is working or not…

How to Disable CTRL Key Combinations on Your Webpages

This is how you can disable CTRL key combinations on your webpages.

Thanks for reading this article!!! We hope this was helpful to all of you.