Hmm, this got me thinking... Would this not be possible with a custom state, or are custom states not allowed on unitframes (Is SecureUnitButtonTemplate inheriting attributes/methods of SecureHandlerStateTemplate)?
lua Code:
PlayerFrame:SetAttribute("_onstate-mousestate", [[
self:EnableMouse(newstate == "enabled")
]]);
-- Normal, not listening to shift
RegisterStateDriver(PlayerFrame, "mousestate", "[combat] disabled; enabled");
-- Disable clicking in combat unless ctrl/shift/alt is pressed
-- RegisterStateDriver(PlayerFrame, "mousestate", "[mod] enabled; [combat] disabled; enabled");