The Main Window for Debugging AutoHotkey Scripts

How to View the Inner Workings and Hidden Mechanisms of Running AutoHotkey Scripts

AutoHotkey includes a tool called the Main Window which aids with the debugging process. It gives you a peek into various aspects of a running .ahk script:

  1. Most recently executed lines of code (ListLines command).
  2. Current variables and values (ListVars command).
  3. Active Hotkeys (ListHotkeys command).
  4. Keyboard activity (KeyHistory command).

Main Window Menu

Open the Main Window by right-clicking on Windows System Tray icon of an active .ahk script and selecting Open from the top of the menu. The window pops open at the “Lines most recently executed” view. You can select the other three views plus “Refresh” from the View menu. Continue reading

New Hotkey Book! (AutoHotkey Tips and Tricks)

AutoHotkey Techniques and Best Practices E-Book for Automating Your Windows Computers with Hotkey Combinations—Includes Something for Everyone!

Whether you’re a noobie to AutoHotkey scripts or an advanced programmer, of all my books, AutoHotkey Hotkeys may be the most important for new little-known tricks and useful ideas. It’s not that the other books don’t cover significant features of AutoHotkey, but this book includes some of the most practical tips for adding power to your scripts. I didn’t plan it that way. Continue reading

When to Use Virtual Keys and Keyboard Scan Codes with AutoHotkey (Beginning Hotkeys Part 14)

Add Missing Keys or Take Advantage of Extra Keyboard Keys with AutoHotkey Scan Codes and Virtual Keys

In preparation for this blog I tested numerous different Hotkey configurations with Virtual Keys and/or keyboard Scan Codes. To say the least, knowing when to use what gets pretty confusing. While many setups might not work, there are multiple other configurations which do the same thing. For that reason, before digging into any details, I’m offering a summary set of thumb rules for figuring out when you might want to use either of these special key codes. (See this previous blog to review Virtual Keys and Scan Codes.)

Continue reading

Understanding AutoHotkey Keyboard Scan Codes and Virtual Key Codes (Beginning Hotkeys Part 12)

Learn the Difference Between AutoHotkey Keyboard Scan Codes (SCnnn) and Virtual Key Codes (VKnn) and When to Use Them for Hotkeys

Not all keyboards are equal. Detached desktop keyboards may include many extra keys while smaller laptop keyboards might be shortened versions of their larger cousins. When setting up Hotkeys, you must work with the keyboard you own. That means using the available keys and the usual AutoHotkey key names and techniques. However, you will likely find key action names in the AutoHotkey Key List with no corresponding key on your particular keyboard (e.g. AppsKey). At other times, you may find keys on your keyboard which don’t appear in the AutoHotkey list. These situations may call for a unique approach to setting up Hotkeys.

Continue reading