Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

Fired when shift/ctrl/alt keys are pressed or released. Does not fire when an EditBox has keyboard focus.

MODIFIER_STATE_CHANGED: key, down

Payload[]

key
string - LCTRL, RCTRL, LSHIFT, RSHIFT, LALT, RALT
down
number - 1 for pressed, 0 for released.

Details[]

Related API IsModifierKeyDown

Example[]

Prints when a modifier key is pressed down.

local function OnEvent(self, event, key, down)
	if down == 1 then
		print("pressed in", key)
	end
end

local f = CreateFrame("Frame")
f:RegisterEvent("MODIFIER_STATE_CHANGED")
f:SetScript("OnEvent", OnEvent)

Patch changes[]

Bc icon Patch 2.2.0 (2007-09-25): First payload now identifies L and R keys.

Advertisement