MACRO click

From Wowpedia
Jump to: navigation, search

Simulates a click on a button widget, triggering its PreClick/OnClick/PostClick script handlers.

/click [options] WidgetName MouseButton Down

Usage

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.

Arguments

The function accepts the following three values separated by whitespace:

WidgetName 
Name of a widget to click. The widget must be a Button, or a subclass of Button.
MouseButton 
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.
Down 
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 = true in 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.

Notes

  • This command calls Button:Click(MouseButton, Down).
  • If the specified widget is already handling a click event (user-initiated or simulated), this command will be silently ignored.