Dear Lifehacker, I read your article on turning any action into a keyboard shortcut using AutoHotkey and my interest was piqued. You described how to remap the keys and create keyboard shortcuts for actions, but what I've always really wanted to do was to turn one key on my keyboard—specificially the Capslock key—into a dedicated minimise button. Is this possible, and if so... how? Signed, AHK Curious
Dear Curious, Yes indeed, this is not only possible, but it's an excellent idea as well. And what's even better, it's totally simple to accomplish with AutoHotkey. If you read our AutoHotkey guide to creating keyboard shortcuts for any action, you've got all the basics you need to know. From there, it's just a matter of knowing the right AutoHotkey command (here's the full list for your perusing pleasure). So let's start basic. Yesterday I showed you how to remap the Capslock key to the Control key like so:
Totally simple, right? Now, to turn your Capslock key into a dedicated minimise key instead, you need to learn a new command—specifically, the WinMinimize command. The new snippet of code that you'll want to add to your AutoHotkey script is:
If you check the WinMinimize page you'll see that the command will minimise the currently active window (that's what the A after "WinMinimize," means).
If you decide to remap your Capslock key, remember that you can still use the traditional Capslock functionality by adding the following to your script to toggle Capslock when you press Shift-Capslock:
If you'd prefer not to use your Capslock key, check out this list of all the key names you could use in place of Capslock (F1-F12, perhaps?).
P.S. AutoHotkey can perform tonnes of similar cool, simple, and useful Windows tweaks, so if you've got a similar question or tweak you'd like to see, send an email to adam at lifehacker.com with AutoHotkey Answers in the subject heading and I'll see if I can't help you out, too.