The API is no longer being updated here until further notice. |
Performs a virtual mouse click on the button.
Button:Click([button, isDown])
Arguments[]
- button
- string?
= LeftButton
- Mouse or virtual button to simulate a click with. - isDown
- boolean?
= false
- true if the button should be considered pressed (but not yet released); otherwise, it'll be considered released.
Details[]
- This function does nothing if the Button widget is disabled, or if the button is already being clicked.
- The arguments to this function will be passed to the widget's PreClick, OnClick, and PostClick script handlers.
- This function ignores the widget's Button:RegisterForClicks preferences, and does not fire the OnMouseDown and OnMouseUp script handlers.
- Only the specified click will be simulated; it is thus possible to simulate multiple down-clicks without any up-clicks or vice versa.
- If you call this function from a tainted execution path, the OnClick handler will also run on a tainted execution path -- you cannot use this function to trigger protected actions from insecure code.
- The /click slash command can be used to call this function securely.