You said moving the camera so this might give you something to start/work with (as currently coded, requires mouseleft to be held down to move the camera but it's up to you):
Lua Code:
local f = CreateFrame("Button", "SomeOnEnterFrame", WorldFrame)
f:SetSize(200, 200)
f:SetPoint("TOPLEFT")
f.t = f:CreateTexture()
f.t:SetAllPoints()
f.t:SetTexture("abc")
f:RegisterForClicks("LeftButtonDown", "LeftButtonUp")
f:SetScript("OnEnter", function(self)
print("Entered")
self:SetSize(400, 400)
end)
f:SetScript("OnLeave", function(self)
print("Left")
if self.MouseLooking or MouseIsOver(self) then
return
end
self:SetSize(200, 200)
end)
f:SetScript("OnClick", function(self, button, down)
if down then
if not self.MouseLooking then
self.MouseLooking = true
MouselookStart()
else
self.MouseLooking = nil
MouselookStop()
end
end
end)
WorldFrame:HookScript("OnMouseUp", function(self, button)
if SomeOnEnterFrame.MouseLooking then
SomeOnEnterFrame:Click(button, true)
end
end)
... or not.
You can't have MouseLook "running" and interact with UI elements at the same time using the mouse.
If MouseLook gets "stuck on" while figuring out all the ins and outs you might need to address, clicking both buttons should unlock it.