MouseGestureL.ahk - Usage Tips
Information on new features, specific examples of settings, and usage precautions that are not described in the attached help file are posted here.
◆ Settings for use in a multi-monitor environment
AutoHotkey does not support per-monitor DPI, which causes issues with cursor coordinates on sub-monitors that have a different display scale than the primary monitor. To avoid this, you need to change the high DPI setting for AutoHotkey.exe as follows.
The gesture function on the sub-monitors will perform properly with above settings, however when the dialog box such as the setting screen is moved to the sub-monitor, the window size is not adjusted automatically according to the display scale.
Please note that this setting change will also affect all AutoHotkey scripts other than MouseGestureL.
◆ Right-click on Chrome's bookmark menu
If you have inherited the default settings from a previous version, right-clicking on the Google Chrome bookmark menu will close the menu.
To avoid this, you need to change the action assigned to "RB_" (pressing the right button) as follows.
RB_:
This setting is the default setting from Ver. 1.41 onwards, so there is no need to change it if you newly install the latest version.
◆ When a mouse button or key gets stuck in a pressed state
There are two sub-scripts in the Tools folder to deal with situations when a mouse button or key gets stuck in a pressed state. "KillMGL.ahk", which kills MGL, and "RestartMGL.ahk", which restarts MGL.
(To restart MGL, only RestartMGL.ahk is needed to run.)
These to be used in emergencies, so creating shortcuts of them in a location that is easy to access in case of an emergency is recommend.
Note that if you start MGL with administrator privileges, these sub-scripts must also be run with administrator privileges, so display the properties of the shortcut and check "Run as administrator" in the "Advanced" settings.
◆ Display the list of registered gestures
If you press F1 key while entering a gesture, a list of gestures that correspond to what you've entered will be displayed.
For example, if you hold down the right button and move the cursor down and then press the F1 key, a list of registered gestures starting with "RB_D" will be displayed.
(The gesture timeout will be temporarily disabled while gesture list is displayed.)
If you move the cursor from that state, the list will close and the gesture recognition process will restart.
The key to display the gesture list can be changed in the "Hotkeys" section of the "Others" settings.
If you include the tag <HideHints> in the comment of the first line of the action script, that gesture will not be displayed in the list.
◆ Temporarily move a window to the edge of the screen or to a sub-monitor, then move it back to its original position later
If you want to move a window to a sub-monitor or to a position that fits perfectly at the edge of the screen, it is easier to set it up by using "Move Window" instead of the conventional "Move and Resize Window".
The sub-monitor or "Original Position" can be selected as the destination on this action. So for example, if you set the destination for Gesture 1 to "Screen Right" (or sub-monitor) and the destination for Gesture 2 to "Original Position", you can temporarily line up the windows you want to compare side by side, and then return them to their original position when you're done.
When moving to the "Original Position", the window that was last moved with this action will be the target, so it doesn't matter where you perform the gesture.
◆ Usage example of "Save current gestures 1"
This action allows you to define a gesture that performs a repeating action such as a rocker gesture, after moving the cursor.
In the example below, holding down the right button and moving the cursor down, then rotating the wheel down will switch to the next task, and rotating the wheel up will switch to the previous task.
RB_D:
RB_DWU_:
RB_DWD_:
RB_D_:
*1 In the usual settings, the asigned action to "RB_DWU_" will be executed only once at the first wheel rotation, and the action of "RB_WU_" will be executed by each rotation thereafter.
That is because the gesture recognition state is reset to "RB_" after the action is executed. (See "Advanced usage" > "Advanced Gestures definitions" > "Continuation motion type gesture" in the MouseGestureL Help)
Calling MG_SaveGesture() at the phase of "RB_D" memorizes the input state of gestures, the recognition state after reset processing will become "RB_D". Therefore the actions of "RB_DWU_" and "RB_DWD_" can be executed repeatedly by each wheel rotation.
*2 When the cursor is kept stationary after pressing the trigger button and moving the cursor, the recognition process will exit by timeout, but you can prevent that by calling MG_DisableTimeout().
*3 When the right button is released, task switching is executed and the action "Send, ^{End}" assigned to "RB_D_" is also fired at the same time, but you can prevent that by branch processing with MG_IsFirstAction().
** In the above example, if "RB_D_" is assigned to the targets other than the Default, the same code must be described for all of those actions. ("Send, ^{End}" must be replaced to individual actions)
If you omit that, the Alt and Shift key will be left pressed. Pay attention when you use this setting example as it is.
In addition, it is recommended to register the following four gestures to prevent accidental operation. Putting the user function for the key release processing to User Extension Script makes simple to describe actions.
Cancel task switch (RB_DL、RB_DR, RB_DU, RB_DD):
◆ Usage example of "Save current gestures 2"
This action cancels all input operations from any point during gesture input until the next time the sub-button is pressed.
For example, if you hold down the right button, move the cursor down, to the right, and then press the left button, it would normally be recognized as the gesture "RB_DRLB_".
However, if you call "Save current gestures 2" (MG_SetBypass("LB")) in the "RB_" action, the "DR" representing the movement of the cursor movement will be deleted from "RB_DRLB_" when the left button has been pressed, and the action assigned to "RB_LB_" will be performed.
This feature was implemented in response to a user request posted on the AutoHotkey forum. For specific usage purposes, see the post below.
https://www.autohotkey.com/boards/viewtopic.php?p=574539#p574539
In the following example, you can see that the action assigned to "RB_LB_" is performed whether you immediately left-click while pressing the right button, or hold down the right button, drag, and then left-click.
RB_:
RB_LB_:
◆ Executing user-defined processing after MGL startup initialization is complete
If you want to execute some processing after MGL startup initialization is complete and before transitioning to idle state, create a function MG_PostInit() in the User Extension Script (MG_User.ahk) and write the processing you want to execute in it.
For example, you can customize the task tray menu for yourself, or start a program or script you want to run after MGL starts.
You can also execute user-defined processing after startup initialization of the configuration dialog box (MG_Edit.ahk) is complete. This function name is ME_PostInit().
These two functions are created by default in MG_User.ahk when you select "Edit User Extension Script" from the task tray menu for the first time.
If MG_User.ahk has already been created, you must add them manually. The place to add them is the "Function and Subroutine Definitions" area (after Goto, MG_User_End).
This feature was implemented in response to the following request posted on the AutoHotkey forum.
https://www.autohotkey.com/boards/viewtopic.php?p=389025#p389025