Here's how I did it, using non-Ace3 speak:
Lua Code:
local MyAddOn = ...
local eventFrame = CreateFrame("Frame")
eventFrame:RegisterEvent("PLAYER_LOGIN")
eventFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
eventFrame:RegiserEvent("PLAYER_REGEN_DISABLED")
function MyAddOn:SetBindings()
-- set your override bindings
end
function MyAddOn:ClearBindings()
-- clear all overrides
end
function MyAddOn:PLAYER_LOGIN()
self:SetBindings()
eventFrame:UnregisterEvent("PLAYER_LOGIN")
end
function MyAddOn:PLAYER_REGEN_ENABLED()
self:SetBindings()
end
function MyAddOn:PLAYER_REGEN_DISABLED()
self:ClearBindings()
end