Determines if the modifiers specified in the click-type had been held down while the button click occurred.. If called from a click handler (OnMouseDown, OnMouseUp, OnClick, OnDoubleClick, PreClick, or PostClick), checks mouse buttons included in the binding; otherwise checks modifiers only (see example).


See also Modified click functions.

Signature:

modifiedClick = IsModifiedClick("type")

Arguments:

  • type - Token identifying a modified click action (string)

Returns:

  • modifiedClick - 1 if the modifier key set bound to the action is active (i.e. the keys are held down); otherwise nil (1nil)

Examples:

print(GetModifiedClick("CHATLINK"))
-- shows "SHIFT-BUTTON1" by default

-- creates a button to respond to the CHATLINK action
TestFrame = CreateFrame("Button", "TestFrame", UIParent, "UIPanelButtonTemplate")
TestFrame:SetWidth(100)
TestFrame:SetHeight(24)
TestFrame:SetPoint("CENTER", 0, -30)
TestFrame:RegisterForClicks("AnyUp")
TestFrame:SetScript("OnEnter", function(self) print(IsModifiedClick("CHATLINK") and "true on enter" or "false on enter") end)
TestFrame:SetScript("OnClick", function(self) print(IsModifiedClick("CHATLINK") and "true on click" or "false on click") end)

-- prints "true on enter" if the Shift key is held while mousing over the button, regardless of mouse button state
-- prints "false on enter" if not holding Shift
-- prints "true on click" only if the button is activated by clicking the primary (left) mouse button while holding the Shift key
-- prints "false on click" if activated by any other mouse button or combination of modifier keys