About 16 hours ago (according to Twitter) I saw the following tweet from Scott Hanselman:
“I need a keyboard with an “http://www.” button.” – shanselman
As ‘tis the season, I thought I’d oblige. :)
- If you haven’t done so already, download and install the wonderful AutoHotKey.
- Create a file called "theHttpKey.ahk". On your desktop is fine for now.
- Enter the following text into the file and save it:
#h:: Send http://www. return
- Double-click the file to load it (you’ll see a little “H” in the tray on your taskbar, which is the default icon for loaded AutoHotKey files).
- Press
Win + h
whenever you want to type “http://www.”. - Enjoy your new HTTP key! :) (or … Profit! for the meme addicted).
If you want this hotkey available all the time, just drag the file or a shortcut to it to your startup folder. If you want to stop the hotkey from working, right click on the icon in the tray and click exit.
So that’s how easy it is to map Win + h
(or #h
in AutoHotKey parlance) to send some text. Or you can always choose a new key combination if you don’t like Win + h
.
If you are not using AutoHotKey you really owe it to yourself to try it. It is just so easy to automate those little things you keep wishing “Wouldn’t it be nice if…”, and this can give you a surprisingly large productivity boost. AutoHotKey can do lots of advanced stuff too (moving windows, adding intellisense to prompts, creating forms etc.), but even without delving right into it you can easily create some useful little mappings (like helping with BDD test naming or simulating Emacs key-bindings).
Enjoy!