I've been using AutoHotkey for a while now. It's made my computer much easier to use.

You can use it to do several things, including:
  • Starting common programs without the mouse
  • Controlling your music and video programs
  • Making Mac shortcuts like Ctrl+Q work everywhere
  • Customizing application keyboard shortcuts


Installation


  1. Download and install AutoHotkey
  2. Create an empty file called shortcuts.ahk
  3. Create a shortcut to that file and put it in the Startup folder


You can then edit the script by right clicking on the green H icon in the corner of the screen and selecting Edit This Script, saving the file, then clicking Reload This Script.

Starting common programs


The Windows key is used for only a few things on a normal computer, such as Win+L to lock the screen. It's easy to add shortcuts for all your favorite programs, for example Win+F for Firefox, Win+I for iTunes, Win+N for Notepad, and so on.

Do this by adding a line like this

#i::Run C:\Program Files\iTunes\iTunes


to your shortcuts.ahk file.

The # means the Windows key (labeled with either a Windows symbol or the word Start), i means the I key, and C:\Program Files\iTunes\iTunes is the command to run when Windows and i are pressed together.

Another trick is to start a program in a maximized window, e.g.

#p::
Run C:\Program Files\PuTTY\PuTTY servername
WinWait, PuTTY
WinMaximize
return


Controlling your music and video programs


I use AutoHotkey to simulate the media buttons that some newer keyboards have, such as back, forward, pause, mute, and so on. I could buy a media keyboard, but I prefer a smaller keyboard that doesn't take up all my desk space.

You can either set it up to control the program in the foreground using something like:

#Left::Send {Media_Prev}
#Right::Send {Media_Next}


or tell it to control iTunes (even if the current window is Windows Media Player) using something like:

#Left::SendMessage, 0x319, 0, 0xC0000, , iTunes
#Right::SendMessage, 0x319, 0, 0xB0000, , iTunes


I also use these to control the volume everywhere:

#Up::Send {Volume_Up}
#Down::Send {Volume_Down}
#NumpadDot::Send {Volume_Mute}
#NumpadDel::Send {Volume_Mute}


Making Mac shortcuts like Ctrl+Q work everywhere


Since using Macs and Linux systems for a while, I find Ctrl+Q a more convenient shortcut to close the current program. A few Windows programs support this, but most of them use Alt+F4.

Adding this rule makes Ctrl+Q equivalent to Alt+F4.

^q::Send !{F4}


Customizing application keyboard shortcuts


I was trying out the Safari web browser, and it wasn't too bad, but the keyboard shortcut to change tabs is Ctrl+Shift+[. Firefox uses Ctrl+PageUp, which is more familiar and easier to press. Unfortunately, Safari doesn't let me change its keyboard shortcuts.

These rules check if the program is Safari then translate Ctrl+PageUp to Ctrl+Shift+[ and similarly for Ctrl+PageDown.

#ifWinActive ahk_class {1C03B488-D53B-4a81-97F8-754559640193}
^PgUp::Send ^+[
#ifWinActive ahk_class {1C03B488-D53B-4a81-97F8-754559640193}
^PgDn::Send ^+]


To find out the class id numbers, right click on the H icon, click on Spy, then click on the window you want to control.

Labels: , , ,