Determining the hovered element
There are some cases when AutoControl needs to determine what kind of element the mouse is hovering over.
This is the so called "hovered element" or "hovered area" and it's needed either when an action has to work
with that element or to decide whether a trigger must fire its action.
There are two special cases, however, in which the hovered element or area will be determined from a previous mouse position
instead of the current mouse position. These cases are:
- When performing a mouse gesture
- When firing an action from an AutoControl menu
When performing a mouse gesture
When a mouse gesture triggers an action that needs to work with the "hovered element", this element will be obtained from
the point the mouse was when the gesture started.
The following animation shows how the actual mouse position is ignored and instead it's the gesture's starting point (marked with a red circle)
the one used to obtain the "hovered element".
When a mouse gesture is completed, the mouse cursor can end up anywhere on the screen and this won't affect at all which element is
chosen as the "hovered element".
There are several types of elements and areas over which you can perform mouse gestures, such as links, images, tabs in the tab strip,
AutoControl menu items, the webpage area, the browser window as a whole, among others.
Additionally, if a mouse gesture has a mouse-over condition, the element used to check if the
condition applies will be the one under the gesture's starting point, as shown in the animation above, and not the current mouse position.
AutoControl menus can contain items that trigger custom actions defined by the user.
If such a custom action needs to work with the "hovered element", that element will be obtained from
the point the mouse was when the menu popped up.
The following animation shows how this point (marked with a red circle) is remembered and then used to determine the "hovered element".
Navigating a menu with the mouse gives the user no control over where on the screen the mouse cursor ends up after clicking a menu item.
For this reason, AutoControl makes an exception and ignores the actual mouse position for the sole purpose of determining the
"hovered element".
This makes possible to create menus with actions that can operate with the element over which the menu was opened.