Pass-Through Hotkey Combinations to Prevent Shortcut Blocking (AutoHotkey Tip)

Sometimes You Want AutoHotkey Hotkeys to Block Other Program Shortcuts While Other Times You Want Both to Work

One of the effects of AutoHotkey Hotkeys includes blocking action for key combinations in Windows and other programs. While often desirable, occasionally you want both the Hotkey and the program shortcut to work. To do this we put a squiggle (tilde prefix ~) in front of the Hotkey combination.

In the MouseMeasure.ahk app, use the cursor keys (Right, Left, Up, Down) to move the mouse cursor one pixel at a time for accurate placement of both ends of the graphic measurement line. Delete to clear the line and ToolTip.

When I added the Arrow keys to the MouseMeasure.ahk script as Hotkeys for precisely locating the mouse cursor onscreen, it triggered the undesirable side effect of blocking the text cursor movement associated with those same keys in editing screens. By placing a tilde (~) in front of each Hotkey, I can accomplish both accurate mouse cursor placement in the invisible GUI and continue using text cursor movement in an editing window without disabling or closing the MouseMeasure.ahk app. (See “Replace Hotkeys with the AutoHotkey GetKeyState() Function” for an introduction to the GDIPlus version of the script. See “How to Draw Lines with AutoHotkey Using Windows GDIPlus Graphics” for information on the GDIPlus functions used in the script.)

Continue reading

Use the ListView GUI Control to Find Duplicate Entries in Data Table Files (AutoHotkey Legal ListView Part 2)

ListView Control Functions in a Loop Work Quickly Locate Repetitious Data

In my last blog, “ListView GUI Control for Viewing Data Table Files (AutoHotkey Legal ListView Part 1)“, I introduced using the ListView GUI control to view and correct a data table file—in this case, an INI file (LegalInput.ini). While sorting and viewing a data table in the ListView control offers many benefits, the most power comes from the 11 built-in functions available for manipulating the control and editing data.

All GUI controls (e.g. Edit, Text, MonthCal, etc.) offer options you can call with the initial Gui, Add command. ListView (and its sister TreeView) include similar options plus special functions for directly manipulating the control. Last time, we used LV_Add() to load the data table rows into the ListView control. This time, we use the LV_GetCount() function (the number of ListView rows) to limit the total number of iterations in a loop, LV_Modify() to focus on each table row in sequential order, and LV_GetText() to retrieve and store data in the row. Continue reading