Hotkeys, Macros, and Gestures: Save Time With Your PC

It's a shame that everyone can't bask in the joy of a function-filled keyboard or multibutton mouse. Consider the convenience of launching applications and controlling a system's volume with the press of a button, rather than awkwardly fumbling your way through menus and prompts within a desktop operating system. And most modern software for these mice and keyboards lets you remap essential parts of your daily routine to buttons a finger's length away.

Fortunately, you can transform a generic mouse or keyboard into a hotkey-friendly superdevice. Doing so is easy and free, meaning that you're only about 20 minutes away from kicking your productivity into high-gear.


Set your own hotkeys in WinHotKey.
The two basic ways to build one-button automation into your standard keyboard are with hotkeys and with macros. A hotkey is a button that triggers a single action such as opening a folder, executing an application, or stopping a song that's playing. A macro (like the ones in Microsoft Excel) is a chain of programmed actions that occur each time you hit a specific button (or launch the macro via an associated program).

This hotkey launches an app.
We'll start with the hotkeys. The freeware application WinHotKey is a great first step toward the world of one-button automation, because it builds a ton of customizations into a program that's pretty simple to use--at least, in comparison to the relatively script-heavy hotkey applications we'll soon be discussing. Once you've installed the application and navigated past its opening tutorial screens, you'll see a list of hotkeys that have already been configured for your system. Keep them by doing nothing, or delete them by highlighting them and clicking Remove Hotkey.

Once you're ready to start automating, click the New Hotkey button. First enter a helpful description in the provided field. When you're finished, note that the app gives you some options for what you want the actual keystrokes of the hotkey to be: It won't let you overwrite an existing hotkey in the program, but you can temporarily overwrite any of Windows' default hotkeys--including good old Ctrl-C (copy)--to perform any of the following tasks, if you wish: launching an application, a document, or a folder; dumping a text string wherever your cursor is; or performing various actions on your desktop's active window.

With that in mind, we strongly recommend that you assign a combination of keystrokes to serve as your new hotkeys. Once you've done so, select your action via the 'I want WinHotKey to...' menu, and you're done! By default, WinHotKey loads when Windows starts up, so your customized hotkeys will always be part of your operating system going forward.


AutoHotkey takes a little work at first, but it's very powerful.
Now that you've played around with hotkeys a bit, it's time to check out their bigger, bolder cousins: macros. The appropriately named freeware application AutoHotkey is our prime target for this task. But we warn you: It's not a walk in the park.

When you install the application, it will ask you whether you want to load a default hotkey script; affirm that you do. What you see next will, at first, look like complete gibberish. That's because AutoHotkey is script-based: There's no user interface to assign macro actions, so you have to type them all in yourself using the appropriate code. It's complicated--so let's walk through a simple example just to get started.

The first line that doesn't start with a semicolon (;)--which indicates a comment--is the following: '#z::Run' In this case, hotkey labels precede the two colons (::), which signify "pressing the keys to the left triggers the command to the right"; for a list of which labels mean what, go here. In our example, the pound sign (#) represents the Windows key. Thus, whenever you hit the Windows key and Z simultaneously, your system will launch the AutoHotkey Website.

To chain multiple actions to one trigger--be it to run an application (like "Run Notepad") or a file (like "Run c:\file.doc") or even a mailing link (like "Run mailto:test@test.tst")--simply list them on separate lines with the word "return" serving as the last line in the macro chunk.Then fire up the AutoHotkey application (you'll see it running in your Windows taskbar), and your one-button macro chain should work without hassle.

That's obviously a very skeletal outline of how to text-edit macros, and it repesents the tip of AutoHotkey's iceberg. Check out the app's official tutorial, as well as Rick Broida's recent Hassle-Free PC article on AutoHotkey, to learn more about controlling PC functions with one push of a button.

The Mouse

Set up gestures to trigger PC actions.
As you might expect, building automated actions into a generic, two-button mouse is trickier because you have only two buttons (and maybe a scroll wheel) to work with. But by using your mouse-drawing abilities, you can transform the act of drawing lines and shapes on your screen into a series of virtual hotkeys.

First, install the freeware application StrokeIt. Fire up the app, and a little mouse cursor will appeared in your system's taskbar (in the lower-right corner of Windows). Now, hold down your right mouse button anywhere on your screen and move the mouse around a little. In response, the mouse becomes in effect a giant digital pen, which StrokeIt analyzes and matches against predefined gestures.

Configure gestures in StrokeIt.
For example, drawing a C on any window will close it; highlighting text and drawing a line from south to north will copy that text onto your clipboard; crudely drawing an E will open a Windows Explorer window; and so on. Even better, StrokeIt lets you assign different gestures to different programs (the app comes with a number of these program-specific doodles already activated).

Learning Mode lets you teach StrokeIt new gestures.
If you want to create your own mouse gestures for a specific action, simply highlight the Global Actions tree, click on the Edit menu, and select Learn Gestures. Start drawing with your right mouse key, and StrokeIt will tell you whether that gesture is already within its database somewhere. If not, save your doodle by clicking the New Gesture button. After that, you can assign your gesture to any existing action within the application. Or if you're ambitious, you can go customize new apps and new actions to perform.

Hotkeys, macros, and gestures are such powerful PC tools that the limits of your imagination are likely to restrain you more than your know-how is. So play around with the various applications we've mentioned, and customize them for your own use. After a little work up-front, the automations you create will serve you well for years to come--and save you a ton of time, long-term. Have your own favorite macros and hotkeys? Share them in the comments!

Subscribe to the Windows Tips & Trends Newsletter