|Useful macros by class|
Simulates a click on a button widget, triggering its PreClick/OnClick/PostClick script handlers.
/click [options] WidgetName MouseButton Down
This command accepts secure command options. The value associated with the first satisfied condition will be interpreted as described below. If no conditions are satisfied, no action will be performed.
The function accepts the following three values separated by whitespace:
- Name of a widget to click. The widget must be a Button, or a subclass of Button.
- Optional - The button to simulate a click with, defaulting to LeftButton. Arbitrary values can be used, and will be passed to the script handlers and returned by GetMouseButtonClicked() during the simulated click.
- Optional - If the first character of this value is "t", or this value is a number greater or equal than 1, a held click will be simulated (
down = truein the relevant handlers); otherwise, a released click will be simulated (
down = false). For convenience, use 1 for the former, and 0 for the latter behavior.
- This command calls
- If the specified widget is already handling a click event (user-initiated or simulated), this command will be silently ignored.