LocSwitch

Description: Returns the current status of the locator (mouse) buttons over the window which contains the LocSwitch statement.
Returns: Numeric
Usage: Script or steady state.
Function Groups: Locator
Related to: Click | SetXLoc | SetYLoc | Target | WinLocSwitch | XLoc | YLoc
Format: LocSwitch()
Parameters: None
Comments: The function has no parameters and therefore the empty parentheses following the function name are optional.
If the locator is not installed, or if it is over a window other than the one containing the module with the LocSwitch statement in it, the function returns 0.
Unlike the WinLocSwitch statement, this function is not triggered by mouse clicks in parent or child windows, only those occurring over the owning window. The return value has the following significance:

Return Value

Mouse Button(s)

No. of Clicks

0

No buttons -

1

Right button

Single

2

Middle button

Single

3

Right & middle button

Single

4

Left button

Single

5

Left & right button

Single

6

Left & middle

Single

7

All three buttons

Single

8

No buttons

-

9

Right button

Double

10

Middle button

Double

11

Right & middle button

Double

12

Left button

Double

13

Left & right button

Double

14

Left & middle

Double

15

All three buttons

Double

Example:

If LocSwitch() == 4 NextState;

This statement causes a state change to NextState at the press of the left mouse button.