Helping people with computers... one answer at a time.

AutoHotkey is a free and powerful utility that allows you to remap, or even reprogram, your keyboard key sequences and more.

How do I create a hotkey for entering my email address? I seem to do this dozens of times a day and it seems to be a chore!

Have I got a recommendation for you. The only caveat is that it's a tad geeky to set up, but it's incredibly powerful. I run it on both my Windows XP desktop and Vista laptop.

AutoHotkey is a free, small program that remains running in your notification area. It intercepts keystrokes (and mouse activity, if you like), and allows you to configure anything from simple remapping of one key to another, to simple text insertion, as you've described, to complex actions that are nearly little programs in and of themselves.

One thing that's easy to overlook is that AutoHotkey works at the keyboard level and is not tied to any application. So anything you use it for is available at any time, regardless of what program you happen to be using.

My needs are fairly simple, so let me show you some of the things that I have AutoHotkey configured to do.

"Automate almost anything by sending keystrokes and mouse clicks."
  • I find myself typing "http://ask-leo.com" a lot, so I have the key sequence "]ta" mapped to that. Any time I type "]ta", in any application, "http://ask-leo.com" is inserted instead.

  • My 8 line email signature (one of several) is automatically typed in for me in response to "]th". I can use that directly in my email program, in a text editing program, or even across a remote desktop or terminal session.

  • The sequence "]dd" inserts the current date like this: 07-Mar-2009.

  • I happen to run "xplorer2" instead of Windows Explorer, so I have the WindowsKey+E keystroke remapped to start xplorer2 instead of Windows Explorer.

  • My Caps Lock key, which I never use for Caps Lock, has been remapped into a MUTE button.

You get the idea. I also have a few shortcuts for common HTML elements that I find myself entering frequently.

Don't let the "]xx" format of my shortcuts throw you either, I chose that. In reality, it can be anything you want - "btw" could automatically type in "by the way", for example. I just chose something that I'd be unlikely to actually ever want literally.

Here are some more ideas from the AutoHotkey home page:

  • Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.

  • Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.

  • Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".

  • Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.

  • Remap keys and buttons on your keyboard, joystick, and mouse.

  • Respond to signals from hand-held remote controls via the WinLIRC client script.

  • Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.

The approach I'm using - hand coding the AutoHotkey macros - can seem a tad geeky, because, well, it is. Here's the AutoHotkey code to type in "http://ask-leo.com":

:*:]ta::
SendEvent http://ask-leo.com
return

"SendEvent" sends keystrokes, but the more confusing part is that ":*:]ta::" part, which defines when the macro should kick in. Once you have that, the rest is fairly easy.

That aside, even with my simple usage I've only skimmed the surface of what AutoHotkey can be used for. Certainly for simple things like text replacement or keystroke remapping it's a near perfect solution.

AutoHotkey - I recommend it.

Article C3668 - March 7, 2009

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
11 Comments

I would also like to recommend the freeware Windows automation engine AutoIt. Much of AutoHotKey's scripting style is based on the old version 2 of AutoIt; AutoIt itself is now in version 3 and has been for years.

As a point of disclosure, I am one of the developers of AutoIt.

Posted by: David Nuttall at September 15, 2009 8:04 PM

WOW!! Thanks for introducing me to AutoHotkey.
Took a bit of savy but now it is so easy and I am using it in all my corespondance.
Keep up the good work
Cheers

Posted by: James Nell at September 16, 2009 1:48 PM

can the keyboard be programmed to start up a computer(windows xp pro)?

Not that I'm aware of.
Leo
15-Dec-2010

Posted by: Barbara Matthews at December 14, 2010 12:06 PM

Thanks, this was literally my exact question. Very helpful, everyone. Cheers.

Posted by: C. DeGama at June 23, 2011 1:30 PM

I find the CAPS LOCK key irritating to the extreme simply because it is so easy to activate the CAPS LOCK and end up typing several lines in unwanted upper case. Could you please advise how to inactivate this key without interfering with the SHIFT KEY function.

Many thanks in anticipation.

Posted by: Maxadolf at August 30, 2011 8:36 AM
Post a comment on "AutoHotkey - Mouse and Keyboard Remapping, Macros and Hotkeys":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...