WoW:MACRO click: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Created page with '{{macroapi}} __NOTOC__ Simulate a mouse click on a frame of type ''Button''. /click options ButtonObj MouseButton Down == Aliases == :''none'' ==Arguments== ;options : See [[…')
 
m (Move page script moved page MACRO click to MACRO click without leaving a redirect)
 
(No difference)

Latest revision as of 04:48, 15 August 2023

Slash commands


Simulate a mouse click on a frame of type Button.

/click options ButtonObj MouseButton Down

Aliases[edit]

none

Arguments[edit]

options
See Making a macro for instructions on how to properly use options.
ButtonObj
The button to click. If the frame's type is not Button, this will silently fail.
MouseButton
The button you wish to simulate the click with. Accepts any value (LeftButton is the default). GetMouseButtonClicked() will return this value.
Down
Simulates a down-click. A value of "true" or "1" will cause a down-click. Any other value will not.

Notes[edit]

  • This macro calls ButtonObj:Click(MouseButton, Down) and triggers its OnClick, PreClick, and PostClick scripts.
  • The button must be clickable (ButtonObj:EnableMouse(true)) and enabled (ButtonObj:Enable()).
  • Unlike physically clicking the mouse button, there is no up-click with a down-click and no down-click with an up-click and you can't hold the virtual MouseButton down.
  • This does not trigger the button's OnMouseDown or OnMouseUp scripts.
  • The macro system prevents infinite loops by not allowing the macro to click itself or click another macro that will return the click (no bouncing reflects here).
  • The same syntax and options as cast can also be used with click. E.g. /click [btn:1] ActionButton1; ActionButton2, /click [target=mouseover,exists] ActionButton1; ActionButton2, etc.