To make life a little easier, I'm using this
Code:
-- set/clear focus with shift + left click
local ModKey = 'Shift'
local MouseButton = 1
local key = ModKey .. '-type' .. (MouseButton or '')
if(self.unit == 'focus') then
self:SetAttribute(key, 'macro')
self:SetAttribute('macrotext', '/clearfocus')
else
self:SetAttribute(key, 'focus')
end
and this
Code:
-- remove SET_FOCUS & CLEAR_FOCUS from menu, to prevent errors
do
for k,v in pairs(UnitPopupMenus) do
for x,y in pairs(UnitPopupMenus[k]) do
if y == "SET_FOCUS" then
table.remove(UnitPopupMenus[k],x)
elseif y == "CLEAR_FOCUS" then
table.remove(UnitPopupMenus[k],x)
end
end
end
end