12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

852 Part IV ■ <strong>Reference</strong>Returns:modifiedClick—1 if the modifier key set bound to the actionis active (i.e. the keys are held down); otherwise nil (1nil)Example:print(GetModifiedClick(“CHATLINK“))-- shows “SHIFT-BUTTON1“ by default-- creates a button to respond to the CHATLINK actionTestFrame = CreateFrame(“Button“, “TestFrame“, UIParent, i“UIPanelButtonTemplate“)TestFrame:SetWidth(100)TestFrame:SetHeight(24)TestFrame:SetPoint(“CENTER“, 0, -30)TestFrame:RegisterForClicks(“AnyUp“)TestFrame:SetScript(“OnEnter“, function(self) iprint(IsModifiedClick(“CHATLINK“) <strong>and</strong> “true on enter“ or i“false on enter“) end)TestFrame:SetScript(“OnClick“, function(self) iprint(IsModifiedClick(“CHATLINK“) <strong>and</strong> “true on click“ or i“false on click“) end)-- prints “true on enter“ if the Shift key is held while mousing-- over the button, regardless <strong>of</strong> 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 <strong>of</strong> modifier keysIsModifierKeyDownReturns whether a modifier key is held down.isDown = IsModifierKeyDown()Modifier keys include Shift, Ctrl, or Alt on either side <strong>of</strong> the keyboard. <strong>WoW</strong>does not recognize plat<strong>for</strong>m-specific modifier keys (such as fn, meta, Windows,or Comm<strong>and</strong>).Returns:isDown—1 if any modifier key is held down; otherwise nil (1nil)IsMountedReturns whether the player is mounted.mounted = IsMounted()Returns:mounted—1 if the player character is riding a summoned mount; otherwise nil(1nil)IsMouseButtonDownReturns whether a given mouse button is held down.isDown = IsMouseButtonDown([button])

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!