API Button RegisterForClicks

Registers the button widget to receive mouse clicks.
 Button:RegisterForClicks([button1, ...])
==Arguments==
:;button1, ...: - A list of combinations of mouse buttons and their click action.
: 
AnyUp - Responds to the up action of any mouse button.
AnyDown - Responds to the down action of any mouse button.
LeftButtonUp, LeftButtonDown
RightButtonUp, RightButtonDown
MiddleButtonUp, MiddleButtonDown
Button4Up, Button4Down
Button5Up, Button5Down
==Details==
* The default button registered on new button objects is LeftButtonUp.
* Pass multiple arguments to register several buttons, or none to remove any previous registrations.
* Subsequent calls replace any prior ones.
* Controls , , , and .
* Does not affect , , nor .
==Example==
local btn = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
btn:SetPoint("CENTER")
btn:SetSize(100, 40)
btn:SetText("Click me")
btn:RegisterForClicks("AnyDown", "AnyUp")
-- only the OnClick script is affected by RegisterForClicks
btn:SetScript("OnClick", function(self, button, down)
	print("OnClick", button, down)
end)
btn:SetScript("OnMouseDown", function(self, button)
	print("OnMouseDown", button)
end)
btn:SetScript("OnMouseUp", function(self, button)
	print("OnMouseUp", button)
end)
When clicking with the left mouse button.