The "http://www." key

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. :)

  1. If you haven’t done so already, download and install the wonderful AutoHotKey.
  2. Create a file called "theHttpKey.ahk". On your desktop is fine for now.
  3. Enter the following text into the file and save it:
    #h::
    Send http://www.
    return
    
  4. 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).
  5. Press Win + h whenever you want to type “http://www.”.
  6. 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!

Comments