Shift-clicking item while EditBox has focus doesn't add itemLink
Ernest314 opened this issue ยท 1 comments
It looks like AceGUI just uses OnMouseDown
but the EditBox isn't receiving that event, since the click isn't happening on the frame itself.
Blizz's chatframe code:
https://github.com/Gethe/wow-ui-source/blob/live/FrameXML/ChatFrame.xml
https://github.com/Gethe/wow-ui-source/blob/live/FrameXML/ChatFrame.lua
There is a GLOBAL_MOUSE_DOWN event but that doesn't feel like the right way to do it.
This is how AceGUI does it:
if not AceGUIEditBoxInsertLink then
-- upgradeable hook
hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIEditBoxInsertLink(...) end)
end
function _G.AceGUIEditBoxInsertLink(text)
for i = 1, AceGUI:GetWidgetCount(Type) do
local editbox = _G["AceGUI-3.0EditBox"..i]
if editbox and editbox:IsVisible() and editbox:HasFocus() then
editbox:Insert(text)
return true
end
end
end
see also:
https://wow.gamepedia.com/API_hooksecurefunc
https://github.com/Gethe/wow-ui-source/blob/live/FrameXML/ChatFrame.lua