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

How to Draw Lines with AutoHotkey Using Windows GDIPlus Graphics

After Laying an Invisible Graphical User Interface (GUI) over Your Computer Screen, You Can Use Windows GDIPlus to Draw Smooth Lines and Shapes

In my last blog (“Replace Hotkeys with the AutoHotkey GetKeyState() Function“), I explained a Hotstring replacement trick as well as introducing GDIPlus graphics drawing functions from an AutoHotkey post by Hellbent. After comparing the functions in the GDIP_All.ahk library with those from Hellbent, I noted that while many were identical, Hellbent added a few more functions which seemed to make the process easier. Although, I haven’t analyzed the details of each function, I have made them work in the MouseMeasure.ahk script. Here I offer an overview to guide you in how to add an invisible GDIPlus graphics drawing overlay to your computer screen.

Since these GDIPlus functions (included in the script) contain the individual DLLCall() functions, they make it easier to implement on-screen graphics without understanding each enigmatic DLL call. A general understanding of how the MouseMeasure.ahk script works with GDIPlus will help you to implement your own AutoHotkey graphics.

Continue reading