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 - "LSHIFT", "RSHIFT", "LCTRL", "RCTRL", "LALT", "RALT".
- down
- number - 1 for pressed, 0 for released.
Example
Using the second payload value (1 and 0 are both true):
frame:SetScript("OnEvent", function(self, event, ...)
if event == "MODIFIER_STATE_CHANGED" then
local key, down = ...
if down ~= 0 then
-- do something
end
end
end)
Patch changes
Patch 2.2.0 (2007-09-25): First payload now identifies L and R keys.