Friday, December 21, 2012

AutoHotkey Script for a Left Hand Menu

Recently, I've started posting AutoHotkey scripts.  AutoHotkey provides a pretty easy way to automate just about anything in Microsoft Windows without having to become a Windows programmer.  If you'd like to learn more, LifeHacker has a pretty nice introduction to AutoHotkey.

In my last couple of posts, I've been talking about tools and techniques to make it easier to keep your right hand on on your pen when you're drawing using a Wacom tablet, for example.  This script also works pretty well for keeping your right hand on a mouse.

Basically, when you run this script the Win+A key will bring up a window and while the window is open the ASDF keys can be mapped to execute ANY command.  Currently, I'm just popping up test messages, but as a next step I'll be adapting this basic framework to to cover my most common actions while working in Adobe Illustrator, for example.

---


; Left Hand Menu

#a::
Hotkey, a, Test, On
Hotkey, s, Test, On
Hotkey, d, Test, On
Hotkey, f, Test, On

Gui, Font, s10, Verdana  ; Set 10-point Verdana.
Gui, Add, Text, ym, (A) Test 
Gui, Add, Text, ym, (S) Test 
Gui, Add, Text, ym, (D) Test 
Gui, Add, Text, ym, (F) Test 
Gui, Show, w500 h100, Left Hand Menu
Return

GuiClose:
Hotkey, a, Off
Hotkey, s, Off
Hotkey, d, Off
Hotkey, f, Off
Gui Destroy
Return

Test:
MsgBox You pressed %A_ThisHotkey%.
return

No comments:

Post a Comment