Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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[]
Patch 2.2.0 (2007-09-25): First payload now identifies L and R keys.