The Basics
This script will let you press Caps Lock+G to quickly Google text from anywhere in Windows or press Caps Lock+D to look up the dictionary definition of a word. These shortcuts are customizable, of course.
Best of all, this clever script still lets you use Caps Lock normally. You can toggle Caps Lock on and off by quickly pressing it twice. If you don’t, Caps Lock will function as a modifier key for shortcuts.
AutoHotkey 101
AutoHotkey is a free Windows application that sits in the background and runs scripts. You can write these scripts yourself or download them. Scripts generally wait for a keypress and perform an action. In this way, AutoHotkey is a quick way of remapping keys in Windows or assigning different actions to keys.
For example, we’ve shown how you can use AutoHotkey to disable the Windows key, preventing it from opening the Start menu and taking you out of full-screen PC games. No need to pry the keycap off the keyboard.
Install AutoHotkey and Get the Script
Download AutoHotkey and install it to begin. Next, download the CapsLock Modifier script.
Extract the AHK script file from the ZIP archive file and place it in any folder on your computer. To run it with AutoHotkey, right-click the script and select “Run Script.”
The script is now running in the background. To toggle Caps Lock on and off, quickly double-tap the Caps Lock key.
If you don’t double-tap, Caps Lock just functions as a modifier key. With the functions built into the script, you can use the following shortcuts anywhere in Windows:
Press Caps Lock + d to find the dictionary definition of a selected word. Press Caps Lock + g to search Google for the selected text anywhere in Windows. Press Caps Lock + t to find the selected word in a thesaurus. Press Caps Lock + w to search for the selected text on Wikipedia.
Want more shortcuts? You can create your own with a little knowledge of AutoHotkey scripts.
To control AutoHotkey, look for the AutoHotkey icon in your notification area—it has a green background with a white H on it. To stop running the script, just right-click the AutoHotkey icon and select “Exit.”
RELATED: How to Write an AutoHotkey Script
How Does It Work?
If you’d like to see what the script does, right-click it and select “Edit Script” instead. This will open the script in Notepad, and you can examine its code. The script is pretty short and easy to understand. We recommend not downloading and running strange scripts without looking at them and understanding them first.
This script was sent to us by Dave Kellog. Here’s the magic part of the script that makes Caps Lock function as a modifier key if it’s pressed twice:
This bit waits to see if Caps Lock is pressed twice and sets Caps Lock on or off. Otherwise, the script captures Caps Lock and uses it for modifier shortcuts.
The rest of the script contains the shortcut actions and a helpful clipboard function that saves the contents of your clipboard and restores them. That part is pretty necessary, as the modifier functions use the clipboard to take actions on the selected text.
Want to see the full script without downloading it? Here it is:
We’ve seen AutoHotkey scripts that turn Caps Lock into a modifier key before, but never one that keeps Caps Lock around as a toggle if you double-press it. It’s very clever. Thanks again to Dave Kellog for sending it to us.