When you sit at the keyboard, there is not so much unpleasantness as accidentally pressing the intermittent key. For example, the Windows key can minimize some full-screen applications.
After doing that, pressing the Alt key can sometimes block all keystrokes completely. If you accidentally hit these keys without realizing it, it can cause serious inconvenience and confusion.
Many of the common solutions to disable key entry in Windows are outdated. For example, Simple Disable Key is no longer free software. Both SharpKeys and KeyTweak are not officially supported by the latest versions of Windows. So what do you do when you have no options? You build yourself!
But don’t be afraid – it’s very simple. In this article, we’ll show you how you can disable any key you want using a free Windows app called AutoHotKey The best part is that it doesn’t require a complicated setup or reboot to take effect.
Download and install AutoHotKey
The first step to disabling keyboard input on your Windows computer is to download a program called AutoHotKey . The link to the latest version will be at the top of the page in a blue button. After downloading AutoHotKey, run the installer.
Proceed with the installation using the default options shown above. When the installation is complete, you can close it completely. We don’t need to run AutoHotKey yet.
Build your own AutoHotKey script
Now that you’ve downloaded AutoHotKey, it’s important to understand what it does. AutoHotKey allows you to create your own scripts that it will compile and run. Think of AutoHotKey as a lightweight programming language specifically designed to automate and create Windows keyboard shortcuts .
Learning a programming language is tricky, but we’re here to make it easy for you to use AutoHotKey‘s capabilities to disable any key input on your keyboard.
Choose your keys
Choose your keys
For this example, we want to disable the Caps Lock key. On this page, you can see that AutoHotKey refers to this key as “CapsLock”. The left column shows the name (s) of the link, and the right column shows which key it matches.
Open a text editor
Open a text editor
Next, open any text editor. It may even be the Notepad that we will be using. In a blank document, enter the key reference name followed by “:: return”.
This is what our Caps Lock example looks like:
Can you believe this is the only line of code needed to disable the key? If you decide you want to disable more than one, you can repeat the same single line of text on a new line for each additional key.
Save your script
Save your script
The next step is to save the script so that it can be run. You will want to choose a permanent location for this, perhaps not on your desktop, because I’ll show you how to make this script run on startup later.
In this example, we have selected the “Scripts” folder in our documents. After choosing the location to save, change the “File Type” to “All Files”. Then enter a filename of your choice and be sure to add the extension “.ahk”. It is very important.
Saving a file as AHK lets your system know that it is meant to be compiled and run using AutoHotKey
Run your AutoHotKey script
After saving the AHK file, navigate to where you saved it in Windows Explorer . You should see that the file icon is a piece of paper with an “H” on it, which means it is associated with an AutoHotKey
Double click the file. You may not notice anything, but you should see an AutoHotKey icon in the taskbar of the taskbar.
When you see it, it may be hidden, so you will need to click the up arrow icon to show the hidden taskbar icons in this case.
Now try using the key you disabled. It works? If not, then you have successfully disabled the key! If so, you may have done something wrong. Read the instructions carefully and try again.
Control your AutoHotKey software
Right-clicking on the AutoHotKey icon in the taskbar of the taskbar opens the following menu:
It is worth touching on two important parameters: “Reload this script” and “Suspend hotkeys”.
There may come a time when you want to edit the AutoHotKey script while it is actively running. Maybe you want, for example, to add another key to lock. After saving the changes to the AHK file, select the Reload this script option. This will allow you to download the changes to the script without having to close and reopen the file.
If you ever want AutoHotKey not to block any keys, select the Pause Hotkeys option. The AutoHotKey taskbar icon changes from “H” to “S” to indicate that hotkeys are locked. To re-enable all hotkeys, repeat the same action again.
The script runs on startup
Now that your script is working, you may decide that it is so important that you want it to automatically start with Windows. It’s easy to do.
Press Windows Key + R to open the Run window. Enter “% appdata%” in it and press Enter. You will be taken to the “Roaming” folder inside “AppData”.
Here navigate through the following folders: Microsoft Windows Start Programs Startup. In another Windows Explorer menu, navigate to the folder where you saved the AutoHotKey script. Right-click it and choose Create Shortcut. This will create a shortcut to the file in the same folder.
Drag this shortcut to your Startup folder.
Adding a script to startup in this way allows you to make changes to the original file location rather than navigating to that folder each time. If you make frequent edits, it will save a lot of time.
That’s all it takes. With one simple line in your AutoHotKey script, you can disable any standard key on your keyboard and get rid of hours of headache. Don’t search the Internet for a simple and free solution to this problem, follow this guide and make it yourself!